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

EJBS in 2 WLS instances

0 views
Skip to first unread message

DK

unread,
Sep 27, 2001, 8:35:09 PM9/27/01
to

Is it possible to invoke an EJB deployed on one instance of WLS 5.1 from an
EJB deployed on another instance of WLS5.1 ? What I find in my tests is that somehow,

getInitialContext() when called from within the app server with the second app
server's url ,
does not change context to point to the new app server....Is it possible to do
this ?
What are we missing ? Thanks in advance for your help/ any pointers/links.

private Context getInitialContext() throws NamingException {

try {
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, url);
return new InitialContext(h);

} catch (NamingException ne) {

System.out.println("Unable to get a connection to the Application Server");
throw ne;
}
}

Dimitri Rakitine

unread,
Sep 27, 2001, 9:10:43 PM9/27/01
to
Do you specify url as http://otherweblogic:7001 or
as t3://otherweblogic:7001? Starting with some sp
http tunneling is disabled by default.

DK <deepa_k...@fanniemae.com> wrote:

> } catch (NamingException ne) {

--
Dimitri

DK

unread,
Sep 27, 2001, 9:24:09 PM9/27/01
to

I specify the url as t3://otherweblogic:7003.
Any other ideas ?

thanks

Dimitri Rakitine

unread,
Sep 27, 2001, 9:34:29 PM9/27/01
to
What does the exception say (ne.printStackTrace()) ?

DK <deepa_k...@fanniemae.com> wrote:

> thanks

--
Dimitri

DK

unread,
Sep 27, 2001, 9:52:17 PM9/27/01
to

Here is the stack trace.TestBean is deployed on
one instance of WLS and ApplicationInitBean on
another instance.

thanks...

The client was unable to lookup the EJBHome with the JNDI name com.fanniemae.con
solidator.adapter.ejb.configuration.ApplicationInitHome on the Application Serve
rjavax.naming.CommunicationException [Root exception is weblogic.rmi.UnmarshalEx
ception: Unmarshalling return
- with nested exception:
[java.lang.ClassNotFoundException: class com.fanniemae.consolidator.adapter.ejb.
configuration.ApplicationInitBeanHomeImpl_ServiceStub previously not found]]
javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundE
xception: class com.fanniemae.consolidator.adapter.ejb.configuration.Application
InitBeanHomeImpl_ServiceStub previously not found
at weblogic.rjvm.MsgAbbrev.read(MsgAbbrev.java:181)
at weblogic.socket.JVMAbbrevSocket.readMsgAbbrevs(JVMAbbrevSocket.java:5
05)
at weblogic.rjvm.MsgAbbrevInputStream.prime(MsgAbbrevInputStream.java:13
4)
at weblogic.rjvm.RJVMImpl.dispatch(RJVMImpl.java:610)
at weblogic.rjvm.ConnectionManagerServer.handleRJVM(ConnectionManagerSer
ver.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:424)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:
23)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

--------------- nested within: ------------------
weblogic.rmi.UnmarshalException: Unmarshalling return
- with nested exception:
[java.lang.ClassNotFoundException: class com.fanniemae.consolidator.adapter.ejb.
configuration.ApplicationInitBeanHomeImpl_ServiceStub previously not found]
at weblogic.jndi.toolkit.BasicWLContext_WLStub.lookup(BasicWLContext_WLS
tub.java:256)
at weblogic.jndi.toolkit.WLContextStub.lookup(WLContextStub.java:545)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.fanniemae.consolidator.adapter.outbound.ConsolidatorConfiguration
EJBClient.lookupHome(ConsolidatorConfigurationEJBClient.java:116)
at com.fanniemae.consolidator.adapter.outbound.ConsolidatorConfiguration
EJBClient.<init>(ConsolidatorConfigurationEJBClient.java:60)
at com.fanniemae.consolidator.adapter.outbound.ConsolidatorConnection.in
it(ConsolidatorConnection.java:87)
at com.fanniemae.consolidator.adapter.outbound.ConsolidatorConnection.<i
nit>(ConsolidatorConnection.java:65)
at com.fanniemae.consolidator.adapter.ejb.test.TestBean.testCon(TestBean
java:66)
at com.fanniemae.consolidator.adapter.ejb.test.TestBeanEOImpl.testCon(Te
stBeanEOImpl.java:56)
at com.fanniemae.consolidator.adapter.ejb.test.TestBeanEOImpl_WLSkel.inv
oke(TestBeanEOImpl_WLSkel.java:173)
at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerOb
jectAdapter.java:347)
at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
tHandler.java:69)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest
java:15)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
ConsolidatorRemoteException: null

Dimitri Rakitine

unread,
Sep 27, 2001, 10:04:51 PM9/27/01
to
Oh - you need stubs on the client WebLogic - by default it is not going
to download them. Or, if security is not an issue in your environment,
you can enable network classloading (on the server which runs TestBean) :

weblogic.system.enableUnsafeClassloading=true

(it was added in some 5.1 service pack - if you run the latest, it should
work).

DK <Deepa_K...@fanniemae.com> wrote:

> thanks...


--
Dimitri

DK

unread,
Sep 27, 2001, 10:15:28 PM9/27/01
to

I tried adding
weblogic.system.enableUnsafeClassloading=true
but this did not help.

A jar file containing the home and remote
interfaces of ApplicationInitBean is already in
the weblogic classpath of the client WLS which contains
Test Bean. What else do I need ?

Thanks again for your help.

Robert Patrick

unread,
Sep 27, 2001, 10:41:00 PM9/27/01
to
Tow possibilities:

1.) Open the EJB jar file and copy all of the Stub classes over to the
client's weblogic classpath.

or:

2.) In addition to making sure that you restarted the client server with
weblogic.system.enableUnsafeClassloading=true in the weblogic.properties
file, you need to make sure that the ClasspathServlet is properly
configured in the server where the bean is deployed.

Hope this helps,
Robert

0 new messages