xiaodududu / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Struts2Factory Fails When a Struts Global Type Converter is Specified #619

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

Attachments:

GoogleCodeExporter commented 9 years ago
Known issue.. don't think there's anything we can do. :-(

Original comment by sberlin on 22 Mar 2011 at 10:20