dcsimg
ClassCastException when calling a Stateful EJB
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alessandro_Valcepina
Posted On:   Tuesday, June 1, 2010 05:18 AM

Hi, i'm working on an application which uses a Stateful EJB and references it in this way: Object homeObject = context.lookup("GestioneRegistrazione"); GestioneRegistrazioneHome home = (GestioneRegistrazioneHome)PortableRemoteObject.narrow(homeObject, GestioneRegistrazioneHome.class); GestioneRegistrazione ejbInstance = (GestioneRegistrazione)PortableRemoteObject.narrow(home.create(), GestioneRegistrazione.class); when GestioneRegistrazioneHome home = (GestioneRegistrazioneHome)PortableRemoteObject.narrow(homeObject, GestioneRegistrazioneHome.class); is executed i get a ClassCastException. Here's the stacktrace:    More>>

Hi,
i'm working on an application which uses a Stateful EJB and references it in this way:



			


Object homeObject = context.lookup("GestioneRegistrazione");

GestioneRegistrazioneHome home = (GestioneRegistrazioneHome)PortableRemoteObject.narrow(homeObject, GestioneRegistrazioneHome.class);

GestioneRegistrazione ejbInstance = (GestioneRegistrazione)PortableRemoteObject.narrow(home.create(), GestioneRegistrazione.class);




when

GestioneRegistrazioneHome home = (GestioneRegistrazioneHome)PortableRemoteObject.narrow(homeObject, GestioneRegistrazioneHome.class);
is executed i get a ClassCastException. Here's the stacktrace:



			
java.lang.Exception: java.lang.ClassCastException
at it.accor.util.BDOnlineTicketCommon.getGestioneRegistrazioneEjb(BDOnlineTicketCommon.java:190)
at it.accor.utils.ws.BDOnlineTicket.recuperaRegistrazioni(BDOnlineTicket.java:184)
at it.accor.ws.WSOnlineTicket.recuperaRegistrazioni(WSOnlineTicket.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:542)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassCastException
at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at it.accor.util.BDOnlineTicketCommon.getGestioneRegistrazioneEjb(BDOnlineTicketCommon.java:177)
... 30 more
Caused by: java.lang.ClassCastException: com.csc.portord.portale.ejb.session.GestioneRegistrazioneBean_i31ubk_HomeImpl_921_WLStub
at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
... 32 more








I can reference stateless EJB in the same way without any problem at all. Both types of EJB are part of another application (which I have as a JAR in the client).
If i try to call those EJBs from the EJB application everything works fine.

Anybody can help me please?

   <<Less
About | Sitemap | Contact