Discussions

EJB programming & troubleshooting: jndi initial contxt ClassNotFoundException

  1. i'm trying out a simple JMS client using the weblogic server8.1 as my JMSserver. While running the code it generates the following error:

    --------------------------------------------------
    D:\examples\JMS>java SimpleQueueReceiver MyQueue
    Queue name is MyQueue
    Could not create JNDI API
            context:javax.naming.NoInitialContextException: Cannot instantiate class
    : weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotFo
    undException: weblogic.jndi.WLInitialContextFactory ]

    -------------------------------------------------
    i have included the weblogic.jar file in my class path and used the following code for initial Context:
    Properties p = new Properties();
    p.put("java.naming.factory.initial",
    "weblogic.jndi.WLInitialContextFactory ");
    p.put("java.naming.provider.url","t3://localhost:7001");
    jndiContext =new InitialContext(p);

    can anyone pls tell me how i can sort this problem.
    thanks
    meenakshi ashokkumar
  2. Delete the whitespace?[ Go to top ]

    Hi,

    Just a guess: it appears as though you have a pending whitespace in this line:

    p.put("java.naming.factory.initial",
    "weblogic.jndi.WLInitialContextFactory ");

    Do you also get the problem if you delete the whitespace before the closing quote?

    Best,
    Guy