Hello,

I am building xwork2 and struts2 from SVN and I was going to deploy
struts2-showcase to start poking around. Unfortunately, on context
startup, an NPE is thrown. The stack trace in the tomcat console 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)

It seems this is reproducible. The offending method is fairly simple,
but the problem appears to be in xwork's
com.opensymphony.xwork2.ActionContext here -

public static ActionContext getContext() {
    ActionContext context = (ActionContext) actionContext.get();

    // Don't do lazy context creation, as it requires container; the
creation of which may
    // precede the context creation
    //if (context == null) {
    //    ValueStack vs = ValueStackFactory.getFactory().createValueStack();
    //    context = new ActionContext(vs.getContext());
    //    setContext(context);
    //}

    return context;
}

The NPE is thrown by a class that is looking for an ActionContext but
doesn't get one.

--
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to