Meaningless Drivel is fun!
The moose likes EJB and other Java EE Technologies and the fly likes Exception while lookup for EJB from Remote client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Exception while lookup for EJB from Remote client" Watch "Exception while lookup for EJB from Remote client" New topic

Exception while lookup for EJB from Remote client

umamaheswari vajravelu

Joined: May 31, 2006
Posts: 1
Currently my application is using JDK1.3.7 and deployed in WebLogic6.1. From the swing client I am creating a InitailContext passing passing the UserId,Password and URL and after getting the InitialContext object accessing the Remote EJB using JNDI lookup.

Now I am trying to deploy this into WebLogic9.1 and using JDK 1.5. I am using the same code here also. When I lookup for the EJB using JNDI name, I am getting

Here is the code for JNDI lookup
MySessionFacade is the EJB we are trying to invoke..

private MySessionFacade getRemoteObject()
ctx = getInitialContext(); //This method is creating InitialContext succesfully
MySessionFacadeHome home;
MySessionFacade remote;
home = (MySessionFacadeHome) ctx.lookup("MySessionFacade");

remote = home.create();
catch(Exception e)

Exception in thread "AWT-EventQueue-0" java.lang.AssertionError: Failed to generate class for com.sampleapp.server.MySessionFacadeBean_tubb6l_HomeImpl_910_WLStub
at weblogic.rmi.internal.StubGenerator.generateStub(
at weblogic.rmi.internal.StubGenerator.generateStub(
at weblogic.rmi.extensions.StubFactory.getStub(
at weblogic.rmi.internal.StubInfo.resolveObject(
at weblogic.rmi.internal.StubInfo.readResolve(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at Source)
at Source)
at Source)
at Source)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(
at weblogic.rmi.internal.ObjectIO.readObject(
at weblogic.rjvm.ResponseImpl.unmarshalReturn(
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(
at weblogic.jndi.internal.ServerNamingNode_910_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(
at weblogic.jndi.internal.WLContextImpl.lookup(
at javax.naming.InitialContext.lookup(Unknown Source)
at com.sampleapp.client.MyClient.getRemoteObject(

Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at weblogic.rmi.internal.StubGenerator.generateStub(
... 34 more
Caused by: access denied (java.lang.RuntimePermission getClassLoader)
at Source)
at Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
at weblogic.utils.classloaders.AugmentableClassLoaderManager.getAugmentableClassLoader(
at weblogic.rmi.internal.ClientRuntimeDescriptor.findLoader(
at weblogic.rmi.internal.ClientRuntimeDescriptor.getInterfaces(
at weblogic.rmi.internal.StubInfo.getInterfaces(
at com.sampleapp.server.MySessionFacadeBean_tubb6l_HomeImpl_910_WLStub.ensureInitialized(Unknown Source)
at com.sampleapp.server.MySessionFacadeBean_tubb6l_HomeImpl_910_WLStub.<init>(Unknown Source)

Uma Maheswari
Purushoth Thambu
Ranch Hand

Joined: May 24, 2003
Posts: 425
Looks like jdk security might be changed in your installation. You can quickly verify by coping the EJB client classes to jre_home/lib/ext folder. If it works then you need to change settings in java.policy file under jre_home/lib/security folder.
I agree. Here's the link:
subject: Exception while lookup for EJB from Remote client
jQuery in Action, 3rd edition