File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Client JAR Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Reply Bookmark "Client JAR Problem" Watch "Client JAR Problem" New topic
Author

Client JAR Problem

Ashutosh Shinde
Ranch Hand

Joined: Jun 07, 2001
Posts: 42
Hi,
I have deployed my ejb's on one weblogic server. I have a client (servlets) running on another weblogic server. The client machine has a jar which contains the Home and the Remote Interfaces of the beans that are deployed on the main server hosting the ejb's. However, I get the following exception when i try to access the beans on the server from the client.
=================================================================
weblogic.rmi.UnmarshalException: Unmarshalling return
- with nested exception:
[java.lang.ClassNotFoundException: class com.opus.epg.useraccess.AdminSystemBeanHomeImpl_ServiceStub previously not found]
at weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLStub.java:256)
at weblogic.jndi.toolkit.WLContextStub.lookup(WLContextStub.java:545)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.opus.epg.classes.utils.EpgApplicationContext.lookup(EpgApplicationContext.java:161)
at com.opus.epg.classes.wi.EpgNavigationController.getInstance(EpgNavigationController.java:110)
at com.opus.epg.servlets.wi.EpgControllerServlet.init(EpgControllerServlet.java:48)
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:390)
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:349)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:338)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:164)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:99)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:742)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:686)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:247)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
=================================================================
I turned on the "-verbose" option while running the server. I find that the class AdminSystemHome is not being loaded. I have placed the jar containing the Home and the remote interfaces in the weblogic\myserver\serverclasses directory and specified path in the weblogic classpath .
Could anyone please shed some light on the possible solution?
Thanks in advance.
Ashutosh
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
It looks to me as though one of the generated stub classes cannot be found on the classpath when the lookup of the bean is made. Some of the generated stubs need to be available as well as the Home and Remote interfaces.
Ashutosh Shinde
Ranch Hand

Joined: Jun 07, 2001
Posts: 42
Hi George,
I always thought that in case of Weblogic , the stubs would be downloaded on the client side when a request was made and that I only needed the Home and the Remote classes for the casting. Is there some setting that one needs to do, to get these stubs downloaded on the client side at runtime? i.e. enable class loading via the network?

Thanks again,
Ashutosh.
George Brown
Ranch Hand

Joined: Sep 26, 2000
Posts: 919
Originally posted by Ashutosh Shinde:
I always thought that in case of Weblogic , the stubs would be downloaded on the client side when a request was made and that I only needed the Home and the Remote classes for the casting.

where did you read that? And have you ever seen it work that way?
I think you have to think of the EJB connection as an RMI connection under the surface, and as with an RMI connection, your client needs access to the stubs.
peter johansson
Greenhorn

Joined: Oct 25, 2001
Posts: 9
You need to deploy the stubs on the client server as well..
regards,
/Peter
Ashutosh Shinde
Ranch Hand

Joined: Jun 07, 2001
Posts: 42
Hi,
An option suggested by a BEA person was to enable unsafeClassLoading while starting weblogic server. So, i enable the above property using system.weblogic.enableUnsafeClassloading=true (or something similar) and the thing worked.Now, i dont need to put the stubs in the client jar.But, I am not sure of the consequences, other than the one exhibited, of setting the mentioned property. I hope that I am not compromising on the security in any manner, because i suppose i am allowing the classes to be loaded from the network. Any suggestions would be most welcome.
ashutosh
 
 
subject: Client JAR Problem
 
Threads others viewed
***** ASSERTION FAILED *****[ getServlet() returned null!! ]
EJB with Weblogic 5.1
EJB with Weblogic 5.1
ServletContext-ges: Servlet failed with Exception
PROBLEMS WITH WEBLOGIC!!!