1) Create the EJB jar (call it jar1) using weblogic.ejbc
2) Run jar1 through weblogic.ejbc using -idl -iiop, creating jar2
3) Deploy jar2 in the java client's classpath
I get the initial context fine, but when I get to this line:
_home = (myHome)(PortableRemoteObject.narrow(ctx, myHome.class));
I get the following error:
java.lang.ClassCastException
at
com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemo
teObject.java:296)
Can anyone give me some assistance?
Thx!
Sandy Barletta
If I use weblogic.jndi.WLInitialContextFactory instead of
com.sun.jndi.cosnaming.CNCtxFactory, what I get back in my context object if
I call getClass().getName() is
com.sun.corba.se.internal.iiop.CDRInputStream$1 and the narrow succeeds.
What gives? Do I have to use the weblogic context factory? I was hoping to
avoid the need for weblogic packages on the client. Also, our whole reason
for using IIOP was to avoid compatibility problems between weblogic servers
running at different version levels. If I have to use the weblogic context
factory, and we have a weblogic client running at a different version from
the server, will there be problem?
Sandy Barletta
"Sandy Barletta" <sbar...@hotmail.com> wrote in message
news:3aa94c5f$1...@newsgroups.bea.com...
> Ok, here's what's going on here. The problem happens when I use
> com.sun.jndi.cosnaming.CNCtxFactory as my initial context factory. After the
> lookup of the home interface, what I get back in my context object if I call
> getClass().getName() is the following:
> com.sun.jndi.cosnaming.CNCtx
> The class cast exception occurs when I try to narrow this to my home
> interface.
I don't think you should be doing this - you should be using lookup
since this context implements the javax.jndi.Context interface and is
not actually your object.
> If I use weblogic.jndi.WLInitialContextFactory instead of
> com.sun.jndi.cosnaming.CNCtxFactory, what I get back in my context object if
> I call getClass().getName() is
> com.sun.corba.se.internal.iiop.CDRInputStream$1 and the narrow succeeds.
So this is an RMI-IIOP representation of the remote JNDI
implementation. In the former case you are using the sun
implementation to map to CosNaming and then relying on WLS to map that
back to JNDI. This certainly works in silversword, so I would be
surprised if it is broken in 6.0
andy