5 Replies Latest reply on Nov 7, 2002 4:21 PM by Juha Lindfors

    Session Bean Call crashes on caller (programatically) change

    Nilseu Padilha Newbie

      Hi there.

      I have one problem. When I call a Session Stateless from a Servlet (I have an application deployed with ANT/XDoclet in a jboss-3.0.3_tomcat-4.1.12 bundle) that´s ok, everything seems to be working fine.

      But when I change the call from the servlet to a helper class(i´m using the Command Pattern) I get an Exception, like jboss couldn´t find the Home Object.
      The Session Bean call from the UsuarioControllerServlet passed to UsuarioListCommand (the Command Pattern class).
      I don´t know if it´s a <ejb-ref> problem, but i guess that only Servlets need <ejb-ref> in web.xml.

      The Session Bean is called, in all allternatives, through a Business Delegate class (UsuarioDelegate).

      The call:

      servlet -> Business Delegate -> Session Beans

      Works pretty fine. BUT the call:

      servlet -> Command Pattern Class -> Business Delegate -> Session Beans

      crashes.

      If anyone passed through a similar problem, please answer me.

      Thanks in advance.


      the Exception:
      ----------------------------------------------------------
      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 AgendaBusiness.ServiceLocator.getHome(ServiceLocator.java:82)
      at AgendaBusiness.UsuarioDelegate.(UsuarioDelegate.java:23)
      at AgendaPresentation.cadastrarusuarios.UsuarioListCommand.execute(UsuarioListCommand.java:26)
      at AgendaPresentation.cadastrarusuarios.UsuarioControllerServlet.processRequest(UsuarioControllerServlet.java:62)
      at AgendaPresentation.cadastrarusuarios.UsuarioControllerServlet.doGet(UsuarioControllerServlet.java:80)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:469)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1040)
      at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151)
      at java.lang.Thread.run(Thread.java:536)