When a global type converter is specified, Struts2 calls the object factory to
create an instance at startup - this causes the Struts2Factory to initialize
too early and causes NPE's later on. A typical stack trace is this:
java.lang.NullPointerException
com.google.inject.struts2.Struts2Factory$ProvidedInterceptor.intercept(Struts2Factory.java:215)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:162)
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
The attached file is a minimal Struts2 application that demonstrates the
problem. I did not include all the required JARs in this file, but am using
Struts 2.2.1.1 and Guice 3.0 rc3. The application will work correctly if the
xwork-conversion.properties file is removed.
Original issue reported on code.google.com by jeffgbut...@gmail.com on 22 Mar 2011 at 10:18
Original issue reported on code.google.com by
jeffgbut...@gmail.com
on 22 Mar 2011 at 10:18Attachments: