Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.ClassCastException PortableRemoteObject.narrow(PortableRemoteObje

843829Apr 8 2004 — edited Apr 12 2004
Hi,

I have a problem with a JNDI -lookup() using the CORBA namig system.

After looking up: System.out.println( lookup("jndi-name") );
I get an IOR: IOR:0000000000000053524d493a...............

ok

then I print out the name and the package of this object:
Object o = lookup("jndi-name");
System.out.println("name of o : " + o.getClass().getName());
System.out.println("package of o : " + o.getClass().getPackage());
and get:
name of o : com.sun.corba.ee.impl.corba.CORBAObjectImpl
package of o : package com.sun.corba.ee.impl.corba

I expected the type of a Home-Interface, so that i could narrow the object o:
PortableRemoteObject.narrow( o , classname);

and the result is a:
java.lang.ClassCastException
at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)........

What's wrong

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 10 2004
Added on Apr 8 2004
1 comment
169 views