2 Replies Latest reply on May 9, 2002 11:21 AM by Ryan Scharer

    RC2 ClassCastException after Redeploy

    Ryan Scharer Newbie

      My deployment consists entirely of EJBs, which I access from a separate servlet container. Under RC1, I could redeploy my app by touching META-INF/ejb-jar.xml and immediately reconnect to it using the container. This stopped working after I upgraded to RC2; when I do a home lookup after recycling the app, I get this error:

      Caused by: java.lang.ClassCastException: $Proxy195
      at com.classwell.assessment.ejb.AssessmentDTOFactorySessionBean.setSessi
      onContext(AssessmentDTOFactorySessionBean.java:85)
      at org.jboss.ejb.StatelessSessionEnterpriseContext.(StatelessSessi
      onEnterpriseContext.java:47)
      at org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSe
      ssionInstancePool.java:61)
      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
      ava:208)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
      elessSessionInstanceInterceptor.java:63)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
      rceptor.java:96)

      I'm using JDK1.4 on win2K.

        • 1. Re: RC2 ClassCastException after Redeploy
          Ryan Scharer Newbie

          The exception occurs during ejb -> ejb lookups within the container... I'm assuming some stale references are sticking around somewhere despite the destroy().

          Here's a better stack trace:
          java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
          java.rmi.ServerException: $Proxy194; nested exception is:
          java.lang.ClassCastException: $Proxy194

          at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)

          at sun.rmi.transport.Transport$1.run(Transport.java:148)

          at java.security.AccessController.doPrivileged(Native Method)

          at sun.rmi.transport.Transport.serviceCall(Transport.java:144)

          at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)

          at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)

          at java.lang.Thread.run(Thread.java:536)

          at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)

          at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)

          at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)

          at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)

          at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)

          at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)

          at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)

          at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)

          at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)

          at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)

          at $Proxy15.getViewResultsDTO(Unknown Source)

          at com.classwell.assessment.AssessmentDTOFactory.getViewResultsDTO(AssessmentDTOFactory.java:43)

          at com.classwell.assessment.administer.ViewResultsAction.performImpl(ViewResultsAction.java:46)

          at com.classwell.common.struts.ClasswellAction.perform(ClasswellAction.java:157)

          at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1787)

          at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)

          at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:126)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)

          at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:82)

          at com.classwell.common.util.TimeTrackerFilter.doFilter(TimeTrackerFilter.java:38)

          at com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:87)

          at com.caucho.server.http.Invocation.service(Invocation.java:288)

          at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:132)

          at com.caucho.server.http.ServletServer.serviceTop(ServletServer.java:937)

          at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:213)

          at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158)

          at com.caucho.server.TcpConnection.run(TcpConnection.java:140)

          at java.lang.Thread.run(Thread.java:536)

          • 2. Re: RC2 ClassCastException after Redeploy
            Ryan Scharer Newbie

            Sorry, that was obviously the client-side stack trace. In any case the takeaway is that A ClassCastException is thrown while attempting to narrow the proxy instance to the XXLocalHome interface inside a given setSessionContext().