• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exception while lookup for EJB from Remote client

 
umamaheswari vajravelu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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 java.security.AccessControlException.

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

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

remote = home.create();
}
catch(Exception e)
{
e.printStackTrace();
}
return(remote);
}
}

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(StubGenerator.java:706)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:697)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:76)
at weblogic.rmi.internal.StubInfo.resolveObject(StubInfo.java:212)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:206)
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 java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:555)
at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:191)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:197)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:315)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:250)
at weblogic.jndi.internal.ServerNamingNode_910_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:374)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:362)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.sampleapp.client.MyClient.getRemoteObject(MyClient.java:142)

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(StubGenerator.java:704)
... 34 more
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
at weblogic.utils.classloaders.AugmentableClassLoaderManager.getAugmentableClassLoader(AugmentableClassLoaderManager.java:48)
at weblogic.rmi.internal.ClientRuntimeDescriptor.findLoader(ClientRuntimeDescriptor.java:241)
at weblogic.rmi.internal.ClientRuntimeDescriptor.getInterfaces(ClientRuntimeDescriptor.java:132)
at weblogic.rmi.internal.StubInfo.getInterfaces(StubInfo.java:78)
at com.sampleapp.server.MySessionFacadeBean_tubb6l_HomeImpl_910_WLStub.ensureInitialized(Unknown Source)
at com.sampleapp.server.MySessionFacadeBean_tubb6l_HomeImpl_910_WLStub.<init>(Unknown Source)
 
Purushoth Thambu
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic