Thanks - sorry about the duplicate. Jeff Butler
On Tue, Mar 22, 2011 at 5:21 PM, Sam Berlin <[email protected]> wrote: > Thanks -- merged it into the existing bug report for that. If you're able > to come up with a solution, please post it to issue 278. Thanks! > sam > > On Tue, Mar 22, 2011 at 6:20 PM, Jeff Butler <[email protected]> wrote: >> >> Got it. Here's the issue report: >> >> http://code.google.com/p/google-guice/issues/detail?id=619 >> >> The problem comes when you specify a global type converter. This >> causes the Struts2Factory ti initialize too early. I'm not confident >> that my one line fix is correct in all cases so I'll keep looking into >> it. >> >> Jeff Butler >> >> On Tue, Mar 22, 2011 at 4:26 PM, Jeff Butler <[email protected]> >> wrote: >> > I'll work on it, but I'm having a hard time duplicating the error so >> > it might be something on my side. I'm trying to figure out what's >> > different between my failing app and my working test app. >> > >> > Jeff Butler >> > >> > >> > On Tue, Mar 22, 2011 at 2:20 PM, Sam Berlin <[email protected]> wrote: >> >> Can you create an issue on the tracker with the fix & a test (that >> >> previously would have failed, but now passes)? >> >> >> >> sam >> >> >> >> On Tue, Mar 22, 2011 at 3:12 PM, Jeff Butler <[email protected]> >> >> wrote: >> >>> >> >>> I've been struggling to get my Struts2+SiteMesh+Guice application >> >>> working. I was getting this stack trace with guice 3.0 rc3 and Struts >> >>> 2.2.1.1: >> >>> >> >>> >> >>> 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.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java: >> >>> 88) >> >>> >> >>> >> >>> com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java: >> >>> 162) >> >>> >> >>> >> >>> >> >>> com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java: >> >>> 58) >> >>> >> >>> >> >>> >> >>> com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java: >> >>> 129) >> >>> >> >>> >> >>> >> >>> com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java: >> >>> 77) >> >>> >> >>> >> >>> com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java: >> >>> 162) >> >>> >> >>> >> >>> >> >>> com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java: >> >>> 58) >> >>> >> >>> >> >>> >> >>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter.doFilter(StrutsPrepareFilter.java: >> >>> 82) >> >>> >> >>> >> >>> 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) >> >>> >> >>> I did a little investigation and found that Struts is calling >> >>> StrutsFactory.buildInterceptor() AFTER Struts2Factory.createInjector() >> >>> is called. This means that the created interceptor never has its >> >>> inject() method called, the created interceptor is added to the list >> >>> of provided interceptors AFTER the initialize loop in the >> >>> buildInterceptor() method. >> >>> >> >>> To fix this, I added the line "providedInterceptor.inject()" to the >> >>> end of the buildInterceptor() method and all seems to be working fine. >> >>> >> >>> So, is this a bug, or do I have something configured wrong? >> >>> >> >>> Thanks! >> >>> Jeff Butler >> >>> >> >>> -- >> >>> You received this message because you are subscribed to the Google >> >>> Groups >> >>> "google-guice" group. >> >>> To post to this group, send email to [email protected]. >> >>> To unsubscribe from this group, send email to >> >>> [email protected]. >> >>> For more options, visit this group at >> >>> http://groups.google.com/group/google-guice?hl=en. >> >>> >> >> >> >> >> > > > -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
