Skip to Content
author's profile photo
Former Member

Looking up Weblogic EJBs from iView

Hello all!

I am trying to setup an iView that pulls data from some Welblogic EJBs. I am having trouble looking up the weblogic EJBs. I have weblogic.jar in the private\lib\ directory in my .par file, but the call to get the InitialContext fails. Any pointers to resolve this will be much appreciated!

Hashtable env = new Hashtable();

env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");

env.put(Context.PROVIDER_URL, "t3://localhost:7001");

Context ctx = new InitialContext(env);

System.out.println("Got context = "ctx" from classloader: "+c.getClassLoader());

The exception I get is:

Apr 20, 2004 04:22:33 PM com.covigna.ejbs.EJBHomeFactory <clinit>

SEVERE: EJBHomeFactory.static(): Unable to get JNDI Context

javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialContextFactory. Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory

at org.apache.tomcat.util.depend.DependClassLoader.loadClassInternal1(DependClassLoader.java:186)

at org.apache.tomcat.util.depend.DependClassLoader12$1.run(DependClassLoader12.java:92)

at java.security.AccessController.doPrivileged(Native Method)

at org.apache.tomcat.util.depend.DependClassLoader12.loadClass(DependClassLoader12.java:90)

at java.lang.ClassLoader.loadClass(ClassLoader.java:250)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:190)

at com.sun.naming.internal.VersionHelper12.loadClass (VersionHelper12.java:40)

at javax.naming.spi.NamingManager.getInitialContextNamingManager.java:647)

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • author's profile photo
    Former Member
    Apr 21, 2004 at 06:40 AM

    We'll the problem seems to be that it can't find the class ;

    Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialContextFactory

    So it's probably that weblogic.jar (if it contains the WLInitialContextFactory class) is not in the class path.

    Check to see if it is in the private/lib dir after its been deployed to tomcat.

    Also, the classloading behaviour is different on SAP J2EE, so I would rather test it there than on tomcat.

    Add comment
    10|10000 characters needed characters exceeded