2 Replies Latest reply on Apr 16, 2004 11:25 AM by plainkeyman

    Redeployment problem

    plainkeyman Newbie

      configuration:
      OS windows 2000
      jboss JBoss_3_2_3 date=200311301445

      i have deployed two applications. one with just a jsp that calls an ejb; the other is the ejb. when i deploy the two, they operate just fine. but when i re-deploy the ejb, the jsp gives me ClassCastException:

      16:03:43,156 ERROR [STDERR] java.lang.ClassCastException
      16:03:43,156 ERROR [STDERR] at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
      16:03:43,171 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
      16:03:43,187 ERROR [STDERR] at org.apache.jsp.test_jsp._jspService(test_jsp.java:54)
      16:03:43,187 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
      16:03:43,203 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      16:03:43,203 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
      16:03:43,218 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      16:03:43,234 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      16:03:43,234 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      16:03:43,250 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      16:03:43,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      16:03:43,281 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
      16:03:43,296 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      16:03:43,312 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      16:03:43,312 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      16:03:43,328 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      16:03:43,359 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      16:03:43,375 ERROR [STDERR] at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
      16:03:43,375 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      16:03:43,437 ERROR [STDERR] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:553)
      16:03:43,453 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      16:03:43,468 ERROR [STDERR] at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      16:03:43,609 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      16:03:43,625 ERROR [STDERR] at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
      16:03:43,625 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      16:03:43,765 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      16:03:43,765 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      16:03:43,781 ERROR [STDERR] at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
      16:03:43,921 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
      16:03:43,937 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      16:03:43,937 ERROR [STDERR] at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
      16:03:44,078 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      16:03:44,093 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
      16:03:44,093 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      16:03:44,218 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
      16:03:44,234 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      16:03:44,234 ERROR [STDERR] at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
      16:03:44,390 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      16:03:44,390 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      16:03:44,406 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      16:03:44,546 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
      16:03:44,562 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
      16:03:44,562 ERROR [STDERR] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
      16:03:44,718 ERROR [STDERR] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
      16:03:44,734 ERROR [STDERR] at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
      16:03:44,734 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
      16:03:44,890 ERROR [STDERR] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
      16:03:44,890 ERROR [STDERR] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
      16:03:44,906 ERROR [STDERR] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
      16:03:45,062 ERROR [STDERR] at java.lang.Thread.run(Thread.java:534)



      what am i doing wrong?

        • 1. Re: Redeployment problem
          Jon Barnett Master

          When you redeploy the client classes (interfaces) in the EJB deployment get unloaded from the JVM and then reloaded. However, the WAR is using the old reference it has, which no longer matches the client class references as they have changed in the reload.

          You could try bouncing (forcing a redeploy) of the WAR after you deploy a new EJB. You can do this by 'touching' the WAR or otherwise changing the date on the WAR file, assuming it is a packed WAR. Otherwise for an unpacked WAR, you just need to 'touch' the WEB-INF/web.xml to force JBoss to redeploy the WAR.

          You can also try packing the client classes for the EJB in the WAR. It might save you from having to bounce the WAR. You might need to also set Java 2 Classloading compliance to false in the Tomcat/Jetty deployment descriptor - jboss-service.xml. YMMV.

          • 2. Re: Redeployment problem
            plainkeyman Newbie

            thank you for your quick response.... you were right, i didn't redistribute the interfaces in the war.

            -- thank you again