Struts 2
  1. Struts 2
  2. WW-2203

struts2 showcase throws NPE when starting app server


    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0
    • Component/s: Example Applications
    • Labels:
    • Environment:

      Using Java 1.6.0_02 on Windows XP, I pulled the struts source from SVN and used maven 2.0.7 to build. Once done, I imported the struts2-showcase war file into my eclipse WTP installation and set it to use my Tomcat 5.5.23.


      When attempting to access the struts2-showcase app, tomcat is unable to deploy it and there is an NPE in the console. It is as follows -
      2007-09-24 13:13:15,750 ERROR (org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/struts2-showcase]:3639) - Exception starting filter struts
      at org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(
      at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(
      at org.apache.struts2.dispatcher.Dispatcher.getContainer(
      at org.apache.struts2.dispatcher.FilterDispatcher.init(
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(
      at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(
      at org.apache.catalina.core.ApplicationFilterConfig.<init>(
      at org.apache.catalina.core.StandardContext.filterStart(
      at org.apache.catalina.core.StandardContext.start(
      at org.apache.catalina.core.ContainerBase.start(
      at org.apache.catalina.core.StandardHost.start(
      at org.apache.catalina.core.ContainerBase.start(
      at org.apache.catalina.core.StandardEngine.start(
      at org.apache.catalina.core.StandardService.start(
      at org.apache.catalina.core.StandardServer.start(
      at org.apache.catalina.startup.Catalina.start(
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      at java.lang.reflect.Method.invoke(
      at org.apache.catalina.startup.Bootstrap.start(
      at org.apache.catalina.startup.Bootstrap.main(

      The offending code is -
      public boolean needsReload()

      { ActionContext ctx = ActionContext.getContext(); return ctx.get(reloadKey) == null && super.needsReload(); }

      The NPE is thrown in the return statement. I would assume that ctx is null. I would write a patch, but I am not sure what should be returned if there is no action context. If it helps any, I am also building xwork2 from scratch (using SVN and maven). When building xwork2 on my system, the XmlConfigurationProviderTest unit test has a failure. This seems odd to me though, since this exception is thrown during tomcat and/or context startup.



          • Assignee:
            Don Brown
            Wes Wannemacher
          • Votes:
            1 Vote for this issue
            3 Start watching this issue


            • Created: