This content has been marked as final.
Show 3 replies
-
1. Re: java.lang.ClassCastException in EBJ lookup
wdfink Nov 3, 2010 9:14 AM (in response to sgingade)It looks like that you use EJB2!
Here you have to lookup as followed:
Object objRef = initialContext.lookup("ebccs.common.ServiceRequestContro");
ServiceRequestControlHome home = javax.rmi.PortableRemoteObject.narrow(objRef, ServiceRequestControlHome.class); -
2. Re: java.lang.ClassCastException in EBJ lookup
sgingade Nov 4, 2010 2:15 AM (in response to wdfink)Thanks for the reply.
I narrowed the lookup, but ran into following exception. Any suggestions?
java.lang.ClassCastException com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229) javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137) ca.cgi.ebccs.common.input.OrderMAXCustProfServlet.doPost(OrderMAXCustProfServlet.java:116) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
java.lang.ClassCastException: $Proxy240 cannot be cast to org.omg.CORBA.Object com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212) javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137) ca.cgi.ebccs.common.input.OrderMAXCustProfServlet.doPost(OrderMAXCustProfServlet.java:116) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
-
3. Re: java.lang.ClassCastException in EBJ lookup
wdfink Nov 4, 2010 3:33 AM (in response to sgingade)Are you sure that 'ebccs.common.ServiceRequestControl' name in JNDI points to the Home interface.
Please look into the JNDIView of the jmx-console (and post it)
A toString() log output of the 'objRef' might help because you will see some informations about the proxy object.
Also you don't prove that you are using EJB2, the approach is not for EJB3!