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

RMI/IIOP ClassCastException

0 views
Skip to first unread message

Hanson Char

unread,
Feb 5, 2002, 11:36:28 AM2/5/02
to

I try to lookup an stateless session EJB home interface via RMI/IIOP. The client
lookup is from tomcat3.3a, and the WL server is 6.1.

The initial context is obtained from something like:

Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
h.put(Context.PROVIDER_URL, "iiop://localhost:7001");
return new InitialContext(h);

Where as the narrow is done via:

private static Object narrow (Object ref, Class c) {
return PortableRemoteObject.narrow(ref, c);
}

The exception is thrown with:

java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:296)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at com.realm.portal.data.security.rbac.ejb.common.EjbFinder.narrow(EjbFinder.java:180)
..

The object returned from WL is narrowed to the class c, where c is loaded by Tomcat
from the web application's classes directory. (ie. webapps/app/WEB-INF/classes)

Any idea of how I can get this RMI/IIOP lookup to work ? (I don't want to use
the t3 protocol so I can dynamically download stubs from WL.)

Thanks,
Hanson


Arjuna Chala

unread,
Feb 5, 2002, 12:22:41 PM2/5/02
to
Can you post the call to narrow().
"Hanson Char" <hc...@therealm.com> wrote in message
news:3c600a0c$1...@newsgroups.bea.com...

Hanson Char

unread,
Feb 5, 2002, 12:37:30 PM2/5/02
to

I missed specifying the "-iiop" option when I did the ejbc20. That's all.

It's fixed now.

Thanks,
Hanson

0 new messages