-
1. Re: ClassCastException
jasonbrome Aug 19, 2002 6:16 PM (in response to gimi)You shouldn't be casting the return value of initial.lookup("SvcJ2X")
Try this:
(Assuming that objRef of type Object, and svcJ2XHome of type SvcJ2XHome, have been previously declared)
objRef = initial.lookup("SvcJ2X");
svcJ2XHome = (SvcJ2XHome)PortableRemoteObject.narrow(objRef, SvcJ2XHome.class); -
2. Re: ClassCastException
jasonbrome Aug 19, 2002 6:19 PM (in response to gimi)Ok, scrub that - I've just re-read your message, and see that the ClassCastException occurs on the PortableRemoteObject.narrow. Any chances that what is bound to SvcJ2X is not what you're expecting?
-
3. Re: ClassCastException
e_zhao Sep 30, 2002 12:52 AM (in response to gimi)Anybody can help this?(I am using Jboss3.0.2)
Object objref = ctx.lookup("Register");
RegisterHome home = (RegisterHome) javax.rmi.PortableRemoteObject.narrow(objref, RegisterHome.class);
java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at com.highbase.servlet.RegisterServlet.doGet(Unknown Source)
at com.highbase.servlet.RegisterServlet.doPost(Unk -
4. Re: ClassCastException
e_zhao Sep 30, 2002 1:12 AM (in response to gimi)ClassCastException:
The problem happends when I update my servlet without modifying EJB files, and re-deploy my ear file.
If I re-start JBOSS server, everything works fine now. -
5. Re: ClassCastException
sgturner Sep 30, 2002 11:42 AM (in response to gimi)Don't need narrowing in JBoss. Not sure this will fix problem, but try:
SvcJ2XHome home = (SvcJ2XHome)initial.lookup ("SvcJ2X");