Uploaded image for project: 'Beehive'
  1. Beehive
  2. BEEHIVE-834

JDBC Control throws NPE after deserialization

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • v1m1
    • 1.0
    • System Controls
    • None
    • Dist built from SVN 201574. RHEL with Tomcat 5.0.28.

    Description

      If I do a redeploy of a war that contains a JDBC Control that has been in use, then my JDBC Controls throw an NPE when used after the redeploy completes. I believe that the cause of this is that the redeploy is causing the session (which contains the JDBC Control) to be serialized. There is a field in the JDBC Control called _resources that is transient so it gets dropped. After the redeploy / deserialization of the session, the _resources remains null but is then used in onRelease().

      Repro:

      • edit build.properties for derby.jar location
      • edit src/org/apache/beehive/samples/petstore/controls/data/DBProperties.java for where you want derby data
      • ant deploy-beehive build war
      • cp petstoreWeb.war $CATALINA_HOME/webapps
      • http://localhost:8080/petstoreWeb/
      • Click initDB
      • Click stopDB
      • cp petstoreWeb.war $CATALINA_HOME/webapps
      • Click initDB
      • Getting an NPE here, but really should be okay.
      • If you wait until the session times out, then you can move on and the NPE doesn?t appear again until your next redeploy

      — browser result from initDB with NPE
      type Exception report
      message
      description The server encountered an internal error () that prevented it from fulfilling this request.
      exception
      javax.servlet.ServletException
      org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:623)
      org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:886)
      org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:600)
      org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:163)
      org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      root cause
      java.lang.NullPointerException
      org.apache.beehive.controls.system.jdbc.JdbcControlImpl.onRelease(JdbcControlImpl.java:126)
      org.apache.beehive.controls.system.jdbc.JdbcControlImplInitializer$_resourceContextResourceEventsEventAdaptor.onRelease(JdbcControlImplInitializer.java:24)
      org.apache.beehive.controls.runtime.bean.ResourceContextImpl.release(ResourceContextImpl.java:144)
      org.apache.beehive.controls.runtime.bean.ControlContainerContext.releaseResources(ControlContainerContext.java:136)
      org.apache.beehive.controls.runtime.bean.ControlContainerContext.endContext(ControlContainerContext.java:64)
      org.apache.beehive.controls.runtime.servlet.ServletBeanContext.endContext(ServletBeanContext.java:92)
      org.apache.beehive.netui.pageflow.internal.JavaControlUtils.uninitializeControlContext(JavaControlUtils.java:85)
      org.apache.beehive.netui.pageflow.PageFlowPageFilter.doFilter(PageFlowPageFilter.java:229)
      org.apache.beehive.netui.pageflow.internal.DefaultForwardRedirectHandler.forward(DefaultForwardRedirectHandler.java:127)
      org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.doForward(PageFlowRequestProcessor.java:1824)
      org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processForwardConfig(PageFlowRequestProcessor.java:1698)
      org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
      org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:600)
      org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:886)
      org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:600)
      org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:163)
      org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.

      — catalina.out content
      24 Jun 2005 01:43:53,366 INFO PageFlowRequestProcessor []: This exception was u
      nhandled by any exception handler.

      Throwable: org.apache.beehive.netui.pageflow.internal.UnhandledException
      Stack Trace:
      org.apache.beehive.netui.pageflow.internal.UnhandledException
      at org.apache.beehive.netui.pageflow.internal.DefaultExceptionsHandler.handleException(DefaultExceptionsHandler.java:117)
      at org.apache.beehive.netui.pageflow.FlowController.handleException(FlowController.java:259)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.handleException(PageFlowRequestProcessor.java:680)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:620)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:886)
      at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:600)
      at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:163)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:595)

      24 Jun 2005 01:43:53,366 INFO PageFlowRequestProcessor []: This exception was unhandled by any exception handler.

      Throwable: org.apache.beehive.netui.pageflow.internal.UnhandledException
      Stack Trace:
      org.apache.beehive.netui.pageflow.internal.UnhandledException
      at org.apache.beehive.netui.pageflow.internal.DefaultExceptionsHandler.handleException(DefaultExceptionsHandler.java:117)
      at org.apache.beehive.netui.pageflow.FlowController.handleException(FlowController.java:259)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.handleException(PageFlowRequestProcessor.java:680)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:620)
      at org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:886)
      at org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:600)
      at org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:163)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
      at java.lang.Thread.run(Thread.java:595)

      Attachments

        1. BEEHIVE-834.txt
          2 kB
          Chad Schoettger

        Activity

          People

            ekoneil Edward O'Neil
            jerjohns Jeremiah Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: