Announcement Announcement Module
Collapse
No announcement yet.
ClassCastException in Petclinic Hibernate/MySQL Example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ClassCastException in Petclinic Hibernate/MySQL Example

    Hi,

    I am able to run the Petclinic example using Hibernate and MySQL. When I select the "Find Owner" link on the welcome page, I receive the following error. It looks like the container is treating the JSP as a servlet? I am deploying in JBoss 3.2.3 with Tomcat 4.1.24 on Redhat Linux with
    JDK 1.4.2_05 and J2EE 1.3. Thanks!

    John Westerkamp

    Internal error
    java.lang.ClassCastException at org.apache.jsp.findOwners_jsp._jspService(findOwne rs_jsp.java:94) at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet .java:853) at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:210) at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet .java:853) at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:432) at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:356) at org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:87) at org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:219) at org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:527) at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:427) at org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(FrameworkServlet.java:342) at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:318) at javax.servlet.http.HttpServlet.service(HttpServlet .java:740) at javax.servlet.http.HttpServlet.service(HttpServlet .java:853) at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643) at org.jboss.web.tomcat.security.JBossSecurityMgrReal m.invoke(JBossSecurityMgrRealm.java:220) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641) at org.apache.catalina.valves.CertificatesValve.invok e(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641) at org.jboss.web.tomcat.tc4.statistics.ContainerStats Valve.invoke(ContainerStatsValve.java:76) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(St andardContext.java:2417) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643) at org.apache.catalina.valves.ErrorDispatcherValve.in voke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641) at org.jboss.web.tomcat.security.SecurityAssociationV alve.invoke(SecurityAssociationValve.java:65) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641) at org.apache.catalina.valves.AccessLogValve.invoke(A ccessLogValve.java:577) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:641) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$Standard PipelineValveContext.invokeNext(StandardPipeline.j ava:643) at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(Co yoteAdapter.java:197) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyo teHandler.java:309) at org.apache.jk.common.HandlerRequest.invoke(Handler Request.java:387) at org.apache.jk.common.ChannelSocket.invoke(ChannelS ocket.java:673) at org.apache.jk.common.ChannelSocket.processConnecti on(ChannelSocket.java:615) at org.apache.jk.common.SocketConnection.runIt(Channe lSocket.java:786) at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:677) at java.lang.Thread.run(Thread.java:534) Cookies:

  • #2
    Ok...I have done some digging and it appears that the offending line is

    status = (org.springframework.web.servlet.support.BindStatu s) pageContext.findAttribute("status");

    so it would appear that the pageContext.findAttribute method is not returning something that can be cast as org.springframework.web.servlet.support.BindStatus .

    This is line 94 of findOwners_jsp.java which is the java version of the findOwners.jsp file. So it does appear that the container is treating it as a JSP and compiling it to a servlet but this cast is an issue. By the way, it also happens in ownerForm.jsp which is converted to ownerForm_jsp.java and produces the same ClassCastException on the exact same line.

    Thoughts? Thanks!

    John W.

    Comment


    • #3
      This appears to be a JBoss caching issue. I upgraded to JBoss 3.2.5 with Tomcat 5.0.26 after reading about problems with caching and various context loaders which was fixed in JBoss 3.2.5. Everything is good now!

      Hopefully, this will help somebody trying to run Spring under JBoss.

      Thanks!

      John Westerkamp

      Comment

      Working...
      X