Showing results for 
Search instead for 
Did you mean: 

Looking up Weblogic EJBs from iView

Former Member
0 Kudos

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(

at org.apache.tomcat.util.depend.DependClassLoader12$

at Method)

at org.apache.tomcat.util.depend.DependClassLoader12.loadClass(

at java.lang.ClassLoader.loadClass(

at java.lang.ClassLoader.loadClassInternal(

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

at java.lang.Class.forName(

at com.sun.naming.internal.VersionHelper12.loadClass (



Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi! Thanks for responding..

Yes, weblogic.jar was getting copied over into the private/lib after deployment.

I did some more research into this - looks like the InitialContext is being loaded by a different classloader. I can get it to load by copying weblogic.jar and my jar into the tomcat/lib/apps directory.

Former Member
0 Kudos


In the Portal Runtime Technology paper: runtime - release 6.0

There is some info about SAP PRT using a different classloader.

(import com.sapportals.portal.prt.jndisupport.InitialContext;)