cancel
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(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!

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

Hi

In the Portal Runtime Technology paper:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/documents/a1-8-4/porta... runtime - release 6.0

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

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

Kr

Henrik