Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

lookup a session bean from servlet running on remote server

3 views
Skip to first unread message

Muhammad Sohaib Ahmad

unread,
Jul 31, 2001, 5:00:08 AM7/31/01
to
Hi All
 
I am facing a strange problem. Requirement in my project is that webapp (JSPs/Servlets) should be on one server and EJBs on a separate server. I have successfully deployed session beans on a server. When I try to lookup from a stand alone test application, the lookup process succeeds but when same code is put inside a servlet (running on different server) to lookup same bean, following exception occurs.
 
javax.naming.CommunicationException.  Root exception is java.lang.ClassNotFoundException: class spoe.ejb.session.bean.MainMenuBeanHomeImpl_ServiceStub previously not found
        at weblogic.rjvm.MsgAbbrev.read(MsgAbbrev.java:184)
        at weblogic.socket.JVMAbbrevSocket.readMsgAbbrevs(JVMAbbrevSocket.java:505)
        at weblogic.rjvm.MsgAbbrevInputStream.prime(MsgAbbrevInputStream.java:134)
        at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:700)
        at weblogic.rjvm.ConnectionManagerServer.handleRJVM(ConnectionManagerServer.java:123)
        at weblogic.rjvm.ConnectionManager.dispatch(ConnectionManager.java:630)
        at weblogic.socket.JVMAbbrevSocket.dispatch(JVMAbbrevSocket.java:393)
        at weblogic.socket.JVMSocketT3.dispatch(JVMSocketT3.java:355)
        at weblogic.socket.NTSocketMuxer.processSockets(NTSocketMuxer.java:429)
        at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
 
--------------- nested within: ------------------
weblogic.rmi.UnmarshalException: Unmarshalling return
 - with nested exception:
[java.lang.ClassNotFoundException: class spoe.ejb.session.bean.MainMenuBeanHomeImpl_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 spoe.servlets.ControllerServlet.getRemoteInterface(ControllerServlet.java:411)
        at spoe.servlets.ControllerServlet.loadRemoteInterfaceLookupTable(ControllerServlet.java:594)
        at spoe.servlets.ControllerServlet.init(ControllerServlet.java:122)
        at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:495)
        at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:453)
        at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:442)
        at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
        at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
        at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
        at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
        at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
        at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
        at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
I dont know why is ClassNotFoundException occuring because I do not stop/start the server having EJBs. When I run the test app, it works but from servlet it fail to lookup bean properly.
Can anybody give me a solution to solve this problem???
 
Regards.
Sohaib
 

Joel Nylund

unread,
Jul 31, 2001, 4:03:30 PM7/31/01
to

yeah, you need to put the stubs for your beans in the weblogic classpath of server running the servlet.

one simple thing to do is when you are creating all your jar's for your ejbs, just dump all the stubs into one extra jar, and use this for the client

-Joel

"Muhammad Sohaib Ahmad" <soh...@techlogix.com> wrote in message news:3b66...@newsgroups.bea.com...

Dimitri Rakitine

unread,
Jul 31, 2001, 5:22:39 PM7/31/01
to
Regular Java client network classloads stubs from WebLogic server, but, for security
reasons, it is disabled between WebLogic servers, so you need generated classes on
the client side.

In some 5.1 service pack this property was added:

weblogic.system.enableUnsafeClassloading=true

which un-disables network classloading. I didn't try this with 6.0, but,
according to this doc: http://www.weblogic.com/docs60/config_xml/properties.html
the new name is UnsafeClassLoadingEnabled and it can be specified in config.xml.

> Regards.
> Sohaib

--
Dimitri

0 new messages