3 Replies Latest reply on Aug 17, 2004 7:03 PM by stanaccy

    hot redeploy ear ClassCastException

    Les Hazlewood Newbie

      Folks,

      I'm using JBoss 3.2.3 with integrated Tomcat.

      I've got an ear that contains everything it needs to operate (i.e. it doesn't depend on any external custom services, jars, ejbs, etc to work). Inside this ear is a war. This war contains a jar that it needs in its WEB-INF/lib directory (its the apache common's taglib standard.jar and is only used in the web app). Since only the web tier needs this jar, I didn't include it in the root of the ear file (or make any corresponding application.xml module elements).

      I start up JBoss.

      I hot deploy. Everything works fine. I then visit a jsp page to see the results of some coding. It shows up as expected.

      I see that something wasn't correct in that page, so I edit it (and only that file) and add in a jstl standard <fmt:message> tag.

      I rebuild and redeploy the entire ear.

      The existing ear undeploys and the new one deploys fine.

      I go back to visit the same jsp page that I just changed.

      The page throws a ClassCastException when trying to evaluate a jstl tag.

      I even tried to do the above without changing any files and just touching the file on the command line. JBoss undeployed and redeployed the same ear, and I get the same ClassCastException when I try to visit the page.

      Why is this happening? I thought when the ear is redeployed, the war gets a new classloader too and it then reloads the standard.jar that is under WEB-INF/lib.

      Here's the stack trace:

      16:38:33,147 ERROR [Engine] ----- Root Cause -----
      java.lang.ClassCastException
      at org.apache.taglibs.standard.tag.common.fmt.BundleSupport.getLocalizationContext(BundleSupport.java:170)
      at org.apache.taglibs.standard.tag.common.fmt.MessageSupport.doEndTag(MessageSupport.java:186)
      at org.apache.jsp.welcome_jsp._jspx_meth_fmt_message_0(welcome_jsp.java:167)
      at org.apache.jsp.welcome_jsp._jspService(welcome_jsp.java:89)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
      at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:72)
      at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:208)
      at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:516)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:415)
      at org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:313)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:289)
      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:256)
      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.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
      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:2417)
      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:171)
      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.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
      at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
      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.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
      at java.lang.Thread.run(Thread.java:534)

      Why on earth is so freaking hard to get JBoss to hot redeploy???

      Thanks very much in advance for any help,

      phar