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

Casting error with iiop

5 views
Skip to first unread message

Nicolas Lejeune

unread,
Jan 10, 2002, 8:48:10 AM1/10/02
to

Hi

I want to call an EJB running in WL5.1 from an EJB running in WL6.1. The wl
context factories are not compatible, so I use iiop and CNCtxFactory (see
code below)

My bean in WL6.1 does the following:

Hashtable ht = new Hashtable();
InitialContext remoteContext = null;
ht.put(InitialContext.PROVIDER_URL, "iiop://nb-luisw2k:80");
ht.put(InitialContext.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.cosnaming.CNCtxFactory");

remoteContext = new InitialContext(ht);

Object obj = remoteContext.lookup("com.b2boost.order.B2bOrder");
h = (B2bOrderHome) javax.rmi.PortableRemoteObject.narrow(obj,
B2bOrderHome.class);

This is the exception I get

java.lang.ClassCastException: Cannot narrow remote object to
com.b2boost.order.B2bOrderHome
at
weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDe
legateImpl.java:103)
at
javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at
com.b2boost.integration.handlers.retailerbip.PORefXMLHandlerBean.performBusi
nessLogic(PORefXMLHandlerBean.java:185)
at
com.b2boost.integration.handlers.retailerbip.PORefXMLHandlerBean.handleXML(P
ORefXMLHandlerBean.java:150)
at
com.b2boost.integration.handlers.retailerbip.PORefXMLHandlerBean_zcde1z_EOIm
pl.handleXML(PORefXMLHandlerBean_zcde1z_EOImpl.java:37)
at
com.b2boost.integration.handlers.IncomingTransformHandlerBean.onMessage(Inco
mingTransformHandlerBean.java:170)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:248)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

I am sure that I use the same class in both environments, I recompiled it
and remade the jar.

Any help greatly appreciated

thanks

Nicolas


Andy Piper

unread,
Jan 11, 2002, 2:55:57 AM1/11/02
to
"Nicolas Lejeune" <nicolas...@b2boost.com> writes:

> I want to call an EJB running in WL5.1 from an EJB running in WL6.1. The wl
> context factories are not compatible, so I use iiop and CNCtxFactory (see
> code below)

I don't understand this, they should be compatible.

This indicates 6.1 can't get at the 5.1 stubs. Are you using 5.1SP11?
You could try putting the stubs in the 6.1 classpath (I think
-clientJar does this).

andy

Nicolas Lejeune

unread,
Jan 11, 2002, 4:46:49 AM1/11/02
to
Andy,

Thanks for your answer.
Regarding your first remark, this is what I get when using t3

javax.naming.CommunicationException. Root exception is
weblogic.socket.UnrecoverableConnectException: [Login failed: 'Incompat
ible version:Incompatible versions - this server:5.1.0 client:6.1.1.0]
at weblogic.socket.Login.checkLoginSuccess(Login.java:77)
at
weblogic.rjvm.t3.T3JVMConnection.connect(T3JVMConnection.java:112)
at
weblogic.rjvm.t3.T3JVMConnection.createConnection(T3JVMConnection.java:164)
at weblogic.rjvm.Protocol.createConnection(Protocol.java:206)
at
weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionManager.jav
a:1002)
at
weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:285)
at
weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:242)
at
weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java:220)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:188)
at
weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:180)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:149)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:207)
at
weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
textFactoryDelegate.java:309)
at
weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialCon
textFactoryDelegate.java:208)
at
weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
ory.java:149)
at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:665)
at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:198)
at
com.b2boost.integration.handlers.retailerbip.PORefXMLHandlerBean.performBusi
nessLogic(PORefXMLHandlerBean.java:172)


at
com.b2boost.integration.handlers.retailerbip.PORefXMLHandlerBean.handleXML(P
ORefXMLHandlerBean.java:150)
at
com.b2boost.integration.handlers.retailerbip.PORefXMLHandlerBean_zcde1z_EOIm
pl.handleXML(PORefXMLHandlerBean_zcde1z_EOImpl.java:37)
at
com.b2boost.integration.handlers.IncomingTransformHandlerBean.onMessage(Inco
mingTransformHandlerBean.java:170)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:248)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

Back to IIOP, as you suggested, I put the jar in the client (WL6.1)
classpath, and this is what I get

org.omg.CORBA.COMM_FAILURE: minor code: 1398079490 completed: No
at
com.sun.corba.se.internal.iiop.IIOPConnection.writeLock(IIOPConnection.java:
919)
at
com.sun.corba.se.internal.iiop.IIOPConnection.send(IIOPConnection.java:980)
at
com.sun.corba.se.internal.iiop.IIOPOutputStream.invoke(IIOPOutputStream.java
:76)
at
com.sun.corba.se.internal.iiop.ClientRequestImpl.invoke(ClientRequestImpl.ja
va:91)
at
com.sun.corba.se.internal.corba.ClientDelegate.invoke(ClientDelegate.java:15
8)
at
com.sun.corba.se.internal.corba.RequestImpl.doInvocation(RequestImpl.java:30
4)
at
com.sun.corba.se.internal.corba.RequestImpl.invoke(RequestImpl.java:223)
at
org.omg.CosNaming._NamingContextStub.resolve(_NamingContextStub.java:156)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:368)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:417)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:395)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at
com.b2boost.integration.handlers.retailerbip.PORefXMLHandlerBean.performBusi
nessLogic(PORefXMLHandlerBean.java:184)


at
com.b2boost.integration.handlers.retailerbip.PORefXMLHandlerBean.handleXML(P
ORefXMLHandlerBean.java:150)
at
com.b2boost.integration.handlers.retailerbip.PORefXMLHandlerBean_zcde1z_EOIm
pl.handleXML(PORefXMLHandlerBean_zcde1z_EOImpl.java:37)
at
com.b2boost.integration.handlers.IncomingTransformHandlerBean.onMessage(Inco
mingTransformHandlerBean.java:170)
at weblogic.ejb20.internal.MDListener.execute(MDListener.java:248)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


I must admit I am completely lost here, because I have no expetise at all
with Corba.

Maybe there is a better way to do it, all I want to do is call an EJB
running in 5.1 from an EJB running in 6.1 :-(

Nicolas

"Andy Piper" <an...@xemacs.org> wrote in message
news:m3ita9u...@beasys.com...

dickw

unread,
Jan 11, 2002, 3:32:21 PM1/11/02
to
WebLogic does not support cross version calls. They say that future
versions probably will be compatible with 6.1 and beyond, but there is not
(and will not be) a supported way to call ejbs in version x from ejbs in
version y where x either x or y is less than 6.1
"Nicolas Lejeune" <nicolas...@b2boost.com> wrote in message
news:3c3e...@newsgroups.bea.com...

Andy Piper

unread,
Jan 14, 2002, 4:23:12 AM1/14/02
to
"dickw" <dwhit...@dgsystems.com> writes:

> WebLogic does not support cross version calls. They say that future
> versions probably will be compatible with 6.1 and beyond, but there is not
> (and will not be) a supported way to call ejbs in version x from ejbs in
> version y where x either x or y is less than 6.1

Actually this is not correct. WLS 5.1SP11 contains a backport of the
6.1 IIOP code specifically to support version interop. SP12 should
complete this support, but 5.1SP11/6.1SP2 should work fine in most
circumstances.

andy

Andy Piper

unread,
Jan 14, 2002, 4:25:42 AM1/14/02
to
"Nicolas Lejeune" <nicolas...@b2boost.com> writes:

> Thanks for your answer.
> Regarding your first remark, this is what I get when using t3

It won't work with t3 - that's not support for versions before 6.1

> Back to IIOP, as you suggested, I put the jar in the client (WL6.1)
> classpath, and this is what I get
>
> org.omg.CORBA.COMM_FAILURE: minor code: 1398079490 completed: No
> at

Ok, now I understand. For server-server you *must* use
WLInitialContextFactory on both servers but also use the iiop protocol
(i.e. not t3). BTW this will only work server-server, *not*
client-server. Don't use CNCtxFactory - that will involve the JDK ORB
which is broken in many ways wrt iiop.

andy

Nicolas Lejeune

unread,
Jan 14, 2002, 9:19:56 AM1/14/02
to
Support told me this interoperability between 5.1 and 6.1 is not working in
SP11. They are working on a patch which should be available early february.
I must say I am very surprised that a market leader such as BEA does not
provide such a basic service.

Nicolas

"Andy Piper" <an...@xemacs.org> wrote in message

news:m3d70df...@beasys.com...

Andy Piper

unread,
Jan 15, 2002, 3:08:17 AM1/15/02
to
"Nicolas Lejeune" <nicolas...@b2boost.com> writes:

> Support told me this interoperability between 5.1 and 6.1 is not working in
> SP11. They are working on a patch which should be available early february.
> I must say I am very surprised that a market leader such as BEA does not
> provide such a basic service.

Basic interop between 6.1SP2 and 5.1SP11 does work. How much works for
you depends on what you are doing. But yes, the "support" support will
be 6.1SP3/5.1SP12.

andy

Nicolas Lejeune

unread,
Jan 15, 2002, 9:12:58 AM1/15/02
to
Doesn't work either

I used:

ht.put(InitialContext.PROVIDER_URL, "iiop://192.168.100.8:80");
ht.put(InitialContext.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");

Result :
The context is created, but the calling bean "freezes" on the lookup of the
home interface. I don't have the latest patch, I have 5.1SP10 and 6.1SP1,
could it be the reason?

The servers are running on the same w2k machine

Nicolas


"Andy Piper" <an...@xemacs.org> wrote in message

news:m37kqlf...@beasys.com...

Andy Piper

unread,
Jan 16, 2002, 4:18:08 AM1/16/02
to
"Nicolas Lejeune" <nicolas...@b2boost.com> writes:

> The context is created, but the calling bean "freezes" on the lookup of the
> home interface. I don't have the latest patch, I have 5.1SP10 and 6.1SP1,
> could it be the reason?

Without SP11 you have no hope. Without SP2 you have some hope.

andy

0 new messages