tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Mixon (qwest)" <rnmi...@qwest.net>
Subject NPE in ActionForm where it is not be possible
Date Sat, 10 Jul 2004 19:31:21 GMT
I am getting a NullPointerException in an action form that should
theoretically not be possible :(
Any ideas/help/suggestions are appreciated. Obviously it "is possible"
:).

I happens when I'm testing. I find a problem, leave my browser up, then
stop/start Tomcat. I select a "home page" link from the page that is
still displayed - its simply an action wrapped simple JSP page with no
dynamic data that serves as  a central bulletin board for my users.
After that is displayed, I go back to the page that I am developing on.
Boom! I get the NPE in the middle of a getter method on the action form.

Here is the method - the NPE is flagged at the line "if
(log.isDebugEnabled()) {".
    ...
    public String getMeasParmsId() {
        if (log.isDebugEnabled()) {
            log.debug("getMeasParmsId()=" + measParmsId);
        }
        return measParmsId;
    }
    ...

The "log" variable is initialized when the Action form is instantiated,
like so:
  public class ChartWizardForm extends ActionForm implements
java.io.Serializable {
      private transient Log log =
LogFactory.getLog(ChartWizardForm.class);
      ...

Obviously I'm missing something pretty basic. Is Tomcat re-using a form
instance across restarts? I've got pretty much default settings in
Tomcat:


Here is the exception stack trace:
2004-07-10 12:21:00 StandardWrapperValve[action]: Servlet.service() for
servlet action threw exception
java.lang.NullPointerException
        at
com.ltoj.webapp.form.ChartWizardForm.getMeasParmsId(ChartWizardForm.java
:137)
        at
com.ltoj.webapp.action.AdminChartWizardAction.stepMeasParms(AdminChartWi
zardAction.java:88)
        at
com.ltoj.webapp.action.AdminChartWizardAction.unspecified(AdminChartWiza
rdAction.java:66)
        at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.j
ava:260)
        at
com.ltoj.webapp.action.BaseAction.execute(BaseAction.java:162)
        at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:484)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
274)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:284)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:204)
        at
com.atlassian.util.profiling.filters.ProfilingFilter.doFilter(ProfilingF
ilter.java:132)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:233)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:204)
        at
com.ltoj.webapp.filter.BreadCrumbFilter.doFilter(BreadCrumbFilter.java:9
4)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:233)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:204)
        at
com.ltoj.webapp.filter.ActionFilter.doFilter(ActionFilter.java:372)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:233)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:204)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:257)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
67)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCon
textValve.java:245)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:199)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:151)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:587)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:149)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
67)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:184)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:151)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:164)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:149)
        at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:578
)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:149)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
67)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:156)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
ntext.java:151)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
67)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:83
3)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
onnection(Http11Protocol.java:732)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:61
9)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:688)
        at java.lang.Thread.run(Thread.java:536)


Thanks - Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message