Struts 2
  1. Struts 2
  2. WW-2203

struts2 showcase throws NPE when starting app server

    Details

    • 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:
      None
    • 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.

      Description

      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
      java.lang.NullPointerException
      at org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:165)
      at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:165)
      at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:59)
      at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:827)
      at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:202)
      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:221)
      at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:302)
      at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:78)
      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3635)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
      at org.apache.catalina.core.StandardService.start(StandardService.java:448)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

      The offending code is -
      @Override
      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.

        Activity

        No work has yet been logged on this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development