14 Replies Latest reply on Jan 2, 2007 11:10 AM by andrew.rw.robinson

    Value injection not always working with Seam 1.1

    andrew.rw.robinson

      I needed some functionality from seam 1.1 compared to 1.0.1, so I just tried to upgrade and I'm having some really bad luck. The worst is problems with the "@In(create=true)" annotation.

      Exception:

      java.lang.NullPointerException
       at com.outlooksoft.cpm.usercontext.UserApplicationViewBean.getCurrentAppSet(UserApplicationViewBean.java:462)
       at com.outlooksoft.cpm.usercontext.UserApplicationViewBean.changeCurrentViewSelection(UserApplicationViewBean.java:492)
       at com.outlooksoft.cpm.usercontext.UserApplicationViewBean.selectMember(UserApplicationViewBean.java:294)
       at com.outlooksoft.cpm.faces.controls.UIMemberSelectionDialog.broadcast(UIMemberSelectionDialog.java:105)
       at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
       at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
       at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)


      In this code, what I am doing in the broadcast is looking up the bean:
      (MemberSelectionDialogBean)context.getApplication().createValueBinding("#{memberSelectionDialogBean}")
       .getValue(context);

      And then calling a method on that bean. The "MemberSelectionDialogBean" is session scoped:
      @Name("memberSelectionDialogBean")
      @Scope(ScopeType.SESSION)
      public class MemberSelectionDialogBean
       implements Serializable {
       ...
       private MemberSelectionDialogListener listener;
       ... }

      It in tern, calls another session scoped bean:
      @LoggedIn
      @Name("currentView")
      @Scope(ScopeType.SESSION)
      public class UserApplicationViewBean
       implements Serializable, MemberSelectionDialogListener {
       ...
       @In(create=true)
       private UserSessionBean userSession;
       ... }


      This user session bean is also session scoped:
      @LoggedIn
      @Name("userSession")
      @Scope(ScopeType.SESSION)
      public class UserSessionBean
       implements Serializable {...}


      So to explain the stack:
      1) a custom control (UIMemberSelectionDialog) processes the broacast during the INVOKE_APPLICATION phase
      2) it looks up a bean from the faces context using a value binding (memberSelectionDialogBean)
      3) it then calls a method on the UserApplicationViewBean

      The problem seems to be that the MemberSelectionDialogBean uses a member variable to call the UserApplicationViewBean that is set programmatically (is not injected). It seams like all of the injections variables on that UserApplicationViewBean are set to null and are not re-set.

      This worked fine on 1.0.1. I know it is ugly code (I need to fix it, but it is a large task). Any thoughts?

      -Andrew



        • 1. Re: Value injection not always working with Seam 1.1
          andrew.rw.robinson

          Well, I fixed this issue, but I am once again into many more of the same type. It seems the "@In(create=true)" is not finding my session beans. It is possibly due to the scope change.

          If I use @In(create=true) on a bean that is session scoped, shouldn't it create the bean in the session regardless of the scope of the bean declaring the variable?

          • 2. Re: Value injection not always working with Seam 1.1
            gavin.king

            Sounds like some kind of mis-configuration / packaging problem. Are you sure all your components are being scanned and installed at startup?

            Are you sure the object that you are injecting into is an object instantiated by Seam, and that the BijectoinInterceptor is being processed?

            @In(create=true) is always going to create the named component, assuming it exists.

            • 3. Re: Value injection not always working with Seam 1.1
              andrew.rw.robinson

              More information:

              I tried changing the scope and that didn't work. Here is more information on this new problem with In:

              Bean:

              @Name("liveReportBean")
              @LoggedIn
              @Scope(ScopeType.CONVERSATION)
              public class LiveReportBean
              {
               ...
               @In(create=true)
               private DimensionInfoCache dimInfoCache;
               ...
               private ReportApplicationContextModel model;
               ...
              
               public DimensionContextModel getModel()
               {
               return this.model;
               }
               ...
               public class ReportApplicationContextModel
               extends DimensionContextModel
               {
               protected void someMethod()
               {
               // dimInfoCache is null in 1.1, why?
               }
               }
              }


              My XHTML/JSF code references this model from using a value binding expression of "#{liveReportBean.model}". My "someMethod" is called when the renderer calls a method on the base class of the model. In 1.0.1 all my "@In(create=true)" variables on the live report bean were set, in 1.1 all are null. I really don't know what is different from 1.0.1 to 1.1 that would stop the in from importing my other beans and injecting them.

              @Name("dimInfoCache")
              @Scope(ScopeType.EVENT)
              public class DimensionInfoCache ...


              Thanks!

              Gavin: to answer your question, In(create=true) works just fine most of the time, but not all of the time, that is what is confusing. This is why I know for sure these beans are being deployed fine. I am wondering if it has to do with serialization?

              • 4. Re: Value injection not always working with Seam 1.1
                andrew.rw.robinson

                It looks like Seam is no longer intercepting all of my calls. Normally the stack would be full of "proxy" class names. Below, there are no proxies, only the "real" classes. So it seams something has changed that seam is no longer createing the proxy.
                here is the stack:

                at com.outlooksoft.cpm.livereport.LiveReportBean$ReportApplicationContextModel.loadDimensions(LiveReportBean.java:1262)
                 at com.outlooksoft.cpm.dimension.data.DimensionContextModel.ensureDimensionsLoaded(DimensionContextModel.java:176)
                 at com.outlooksoft.cpm.dimension.data.DimensionContextModel.getDimensions(DimensionContextModel.java:145)
                 at com.outlooksoft.cpm.faces.controls.HtmlDimensionContextRenderer.encodeDimensions(HtmlDimensionContextRenderer.java:249)
                 at com.outlooksoft.cpm.faces.controls.HtmlDimensionContextRenderer.encodeEnd(HtmlDimensionContextRenderer.java:175)
                 at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
                 at org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChild(RendererUtils.java:442)
                 at org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.renderChildren(RendererUtils.java:419)
                 at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:75)
                 at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
                 at org.ajaxanywhere.jsf.ZoneUIComponent.renderComponent(ZoneUIComponent.java:90)
                 at org.ajaxanywhere.jsf.ZoneUIComponent.renderChildren(ZoneUIComponent.java:71)
                 at org.ajaxanywhere.jsf.ZoneUIComponent.encodeChildren(ZoneUIComponent.java:51)
                 at com.outlooksoft.cpm.faces.controls.UIAjaxZone.encodeChildren(UIAjaxZone.java:51)
                 at org.ajaxanywhere.jsf.ZoneUIComponent.renderComponent(ZoneUIComponent.java:86)
                 at org.ajaxanywhere.jsf.ZoneUIComponent.renderChildren(ZoneUIComponent.java:71)
                 at org.ajaxanywhere.jsf.ZoneUIComponent.renderComponent(ZoneUIComponent.java:88)
                 at org.ajaxanywhere.jsf.ZoneUIComponent.renderChildren(ZoneUIComponent.java:71)
                 at org.ajaxanywhere.jsf.ZoneUIComponent.renderComponent(ZoneUIComponent.java:88)
                 at org.ajaxanywhere.jsf.ZoneUIComponent.renderChildren(ZoneUIComponent.java:71)
                 at org.ajaxanywhere.jsf.ZoneUIComponent.encodeChildren(ZoneUIComponent.java:51)
                 at com.outlooksoft.cpm.faces.controls.UIAjaxZone.encodeChildren(UIAjaxZone.java:51)
                 at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:557)
                 at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:562)
                 at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:562)
                 at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:562)
                 at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:562)
                 at com.sun.facelets.FaceletViewHandler.encodeRecursive(FaceletViewHandler.java:562)
                 at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:457)
                 at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
                


                I have not changed any configuration yet. Was there something that changed from 1.0.1 to 1.1 that I missed? The change log didn't seam to say anything.

                Here is my technology stack:
                MyFaces 1.1.3 (patched)
                MyFaces Tomahawk 1.1.3 (patched)
                AjaxAnywhere 1.1.0.6
                Seam 1.1.0
                Facelets 1.0.14

                • 5. Re: Value injection not always working with Seam 1.1
                  gavin.king

                  How is the object being instantiated? Put a breakpoint in the constructor, and show me the stack.

                  • 6. Re: Value injection not always working with Seam 1.1
                    gavin.king

                    Also show the ejb-jar.xml

                    • 7. Re: Value injection not always working with Seam 1.1
                      andrew.rw.robinson

                      Here is the stack from the inner-class constructor:

                      16:26:38,374 INFO [STDOUT] java.lang.Exception: Stack trace
                      16:26:38,375 INFO [STDOUT] at java.lang.Thread.dumpStack(Thread.java:1158)
                      16:26:38,375 INFO [STDOUT] at com.outlooksoft.cpm.livereport.LiveReportBean$ReportApplicationContextModel.<init>(LiveReportBean.java:1245)
                      16:26:38,375 INFO [STDOUT] at com.outlooksoft.cpm.livereport.LiveReportBean.setApplicationContextVisible(LiveReportBean.java:230)
                      16:26:38,376 INFO [STDOUT] at com.outlooksoft.cpm.livereport.LiveReportBean.toggleApplicationViewVisible(LiveReportBean.java:596)
                      16:26:38,376 INFO [STDOUT] at com.outlooksoft.cpm.livereport.LiveReportBean$$FastClassByCGLIB$$489e1ac.invoke(<generated>)
                      16:26:38,376 INFO [STDOUT] at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                      16:26:38,376 INFO [STDOUT] at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
                      16:26:38,376 INFO [STDOUT] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
                      16:26:38,377 INFO [STDOUT] at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:51)
                      16:26:38,377 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
                      16:26:38,377 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      16:26:38,377 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
                      16:26:38,378 INFO [STDOUT] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                      16:26:38,378 INFO [STDOUT] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                      16:26:38,378 INFO [STDOUT] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                      16:26:38,378 INFO [STDOUT] at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
                      16:26:38,378 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source)
                      16:26:38,378 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      16:26:38,378 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
                      16:26:38,378 INFO [STDOUT] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                      16:26:38,378 INFO [STDOUT] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                      16:26:38,378 INFO [STDOUT] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                      16:26:38,378 INFO [STDOUT] at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:51)
                      16:26:38,378 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
                      16:26:38,379 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      16:26:38,379 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
                      16:26:38,379 INFO [STDOUT] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                      16:26:38,379 INFO [STDOUT] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                      16:26:38,379 INFO [STDOUT] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                      16:26:38,379 INFO [STDOUT] at com.outlooksoft.cpm.security.LoggedInInterceptor.checkLoggedIn(LoggedInInterceptor.java:35)
                      16:26:38,379 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source)
                      16:26:38,379 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      16:26:38,379 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
                      16:26:38,379 INFO [STDOUT] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                      16:26:38,379 INFO [STDOUT] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                      16:26:38,379 INFO [STDOUT] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                      16:26:38,379 INFO [STDOUT] at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:39)
                      16:26:38,380 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)
                      16:26:38,380 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      16:26:38,380 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
                      16:26:38,380 INFO [STDOUT] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                      16:26:38,380 INFO [STDOUT] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                      16:26:38,380 INFO [STDOUT] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                      16:26:38,380 INFO [STDOUT] at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:33)
                      16:26:38,380 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor120.invoke(Unknown Source)
                      16:26:38,380 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      16:26:38,380 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
                      16:26:38,380 INFO [STDOUT] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                      16:26:38,380 INFO [STDOUT] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                      16:26:38,419 INFO [STDOUT] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                      16:26:38,419 INFO [STDOUT] at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:38)
                      16:26:38,419 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor119.invoke(Unknown Source)
                      16:26:38,419 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      16:26:38,419 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
                      16:26:38,420 INFO [STDOUT] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                      16:26:38,420 INFO [STDOUT] at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                      16:26:38,420 INFO [STDOUT] at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                      16:26:38,420 INFO [STDOUT] at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
                      16:26:38,420 INFO [STDOUT] at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
                      16:26:38,421 INFO [STDOUT] at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
                      16:26:38,421 INFO [STDOUT] at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:144)
                      16:26:38,421 INFO [STDOUT] at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:79)
                      16:26:38,421 INFO [STDOUT] at com.outlooksoft.cpm.livereport.LiveReportBean$$EnhancerByCGLIB$$a6eaffb4.toggleApplicationViewVisible(<generated>)
                      16:26:38,421 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      16:26:38,421 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                      16:26:38,421 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                      16:26:38,422 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
                      16:26:38,422 INFO [STDOUT] at com.sun.el.parser.AstValue.invoke(AstValue.java:130)
                      16:26:38,422 INFO [STDOUT] at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
                      16:26:38,422 INFO [STDOUT] at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                      16:26:38,422 INFO [STDOUT] at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
                      16:26:38,422 INFO [STDOUT] at javax.faces.component.UICommand.broadcast(UICommand.java:86)
                      16:26:38,422 INFO [STDOUT] at com.outlooksoft.cpm.faces.controls.AjaxCommandLink.broadcast(AjaxCommandLink.java:136)
                      16:26:38,422 INFO [STDOUT] at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
                      16:26:38,422 INFO [STDOUT] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
                      16:26:38,422 INFO [STDOUT] at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
                      16:26:38,422 INFO [STDOUT] at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
                      16:26:38,422 INFO [STDOUT] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
                      16:26:38,423 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
                      16:26:38,423 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      16:26:38,423 INFO [STDOUT] at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:181)
                      16:26:38,423 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      16:26:38,423 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      16:26:38,423 INFO [STDOUT] at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:32)
                      16:26:38,423 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      16:26:38,423 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      16:26:38,423 INFO [STDOUT] at com.outlooksoft.cpm.servlet.AjaxHtmlHeadFilter.doFilter(AjaxHtmlHeadFilter.java:78)
                      16:26:38,423 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      16:26:38,423 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      16:26:38,423 INFO [STDOUT] at com.outlooksoft.cpm.servlet.ExceptionLogFilter.doFilter(ExceptionLogFilter.java:43)
                      16:26:38,424 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      16:26:38,424 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      16:26:38,424 INFO [STDOUT] at com.outlooksoft.cpm.security.SecurityFilter.doFilter(SecurityFilter.java:194)
                      16:26:38,424 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      16:26:38,424 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      16:26:38,424 INFO [STDOUT] at org.ajaxanywhere.AAFilter.doFilter(AAFilter.java:57)
                      16:26:38,424 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      16:26:38,438 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      16:26:38,438 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
                      16:26:38,438 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                      16:26:38,438 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                      16:26:38,438 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                      16:26:38,439 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                      16:26:38,439 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
                      16:26:38,439 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
                      16:26:38,439 INFO [STDOUT] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
                      16:26:38,439 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
                      16:26:38,440 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                      16:26:38,440 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                      16:26:38,440 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                      16:26:38,440 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                      16:26:38,440 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
                      16:26:38,441 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
                      16:26:38,441 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                      16:26:38,443 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                      16:26:38,443 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
                      


                      This is strictly POJO, so there is no ejb-jar.xml

                      • 8. Re: Value injection not always working with Seam 1.1
                        gavin.king

                        Wait, hold on, what is this stuff about an inner class?? It has no @Name annotation? Why should it be proxied?

                        • 9. Re: Value injection not always working with Seam 1.1
                          gavin.king

                          So, in some *beta* versions of Seam, @Name was (wrongly) declared @Inherited, but not in any GA version....

                          • 10. Re: Value injection not always working with Seam 1.1
                            andrew.rw.robinson

                            An inner class is part of the outer class. If the outer class as @In variables, they should be visible from the inner class. Inner classes are not independant of their outer classes. It worked just fine in 1.0.1.

                            Are you saying that this is no longer supported?

                            • 11. Re: Value injection not always working with Seam 1.1
                              gavin.king

                              OK, now I know what changed.


                              The bijected variables of the outer class *only* have well-defined values during a method call to the outer class! They do not have well-defined values after the invocation ends. To enforce this, Seam now nullifies injected variables at the end of the invocations. So the following will not work:

                              foo.getInnerClass().bar()

                              Of course, you could have getInnerClass() construct a new instance of InnerClass, and initialize its instance variables to the value of the bijected variables in the constructor.

                              • 12. Re: Value injection not always working with Seam 1.1
                                andrew.rw.robinson

                                Okay, that fixed the inner class problem (I moved my code to an external class). However, I am getting exceptions, where it *should* be working. I have a class that is called via EL, it is SESSION scoped, and the "@In(create=true)" variables are still null! I don't know if there is some kind of recursive dependency problem that is causing this, but I do know it was working fine in 1.0.1.

                                Here is the method it fails in:

                                 ...
                                 @In(create=true)
                                 private MemberSelectionDialogBean memberSelectionDialogBean;
                                 ...
                                 public void selectMember(Set<HierarchyDimensionMember> selected)
                                 {
                                 HierarchyDimensionMember newValue = selected.iterator().next();
                                
                                 String oldValue = currentViewValues.get(currentDimensionName);
                                 currentViewValues.put(currentDimensionName, newValue.getKey());
                                 changeCurrentViewSelection(currentDimensionName, oldValue, newValue.getKey());
                                
                                 memberSelectorVisible = false;
                                 memberSelectionDialogBean.setDimension(null); /* ERROR occurs
                                 here, as memberSelectionDialogBean is null */
                                 memberSelectionDialogBean.setVisible(false);
                                 memberSelectionDialogBean.setListener(null);
                                 }


                                Here is the declaration of the class:
                                @Name("memberSelectionDialogBean")
                                @Scope(ScopeType.SESSION)
                                public class MemberSelectionDialogBean
                                 implements Serializable {...}


                                Here is the stack (it is long...):
                                java.lang.NullPointerException
                                 at com.outlooksoft.cpm.usercontext.UserApplicationViewBean.selectMember(UserApplicationViewBean.java:297)
                                 at com.outlooksoft.cpm.usercontext.UserApplicationViewBean$$FastClassByCGLIB$$ff27af7e.invoke(<generated>)
                                 at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
                                 at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
                                 at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:51)
                                 at sun.reflect.GeneratedMethodAccessor450.invoke(Unknown Source)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                                 at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
                                 at sun.reflect.GeneratedMethodAccessor449.invoke(Unknown Source)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                                 at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:51)
                                 at sun.reflect.GeneratedMethodAccessor448.invoke(Unknown Source)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                                 at com.outlooksoft.cpm.security.LoggedInInterceptor.checkLoggedIn(LoggedInInterceptor.java:35)
                                 at sun.reflect.GeneratedMethodAccessor454.invoke(Unknown Source)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                                 at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:33)
                                 at sun.reflect.GeneratedMethodAccessor447.invoke(Unknown Source)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                                 at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:38)
                                 at sun.reflect.GeneratedMethodAccessor446.invoke(Unknown Source)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                                 at org.jboss.seam.interceptors.SynchronizationInterceptor.serialize(SynchronizationInterceptor.java:30)
                                 at sun.reflect.GeneratedMethodAccessor451.invoke(Unknown Source)
                                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                 at java.lang.reflect.Method.invoke(Method.java:585)
                                 at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
                                 at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
                                 at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
                                 at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
                                 at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
                                 at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
                                 at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:144)
                                 at org.jboss.seam.intercept.JavaBeanInterceptor.intercept(JavaBeanInterceptor.java:79)
                                 at com.outlooksoft.cpm.usercontext.UserApplicationViewBean$$EnhancerByCGLIB$$174481fc.selectMember(<generated>)
                                 at com.outlooksoft.cpm.faces.controls.UIMemberSelectionDialog.broadcast(UIMemberSelectionDialog.java:105)
                                 at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:94)
                                 at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:168)
                                 at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
                                 at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
                                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
                                


                                I am not sure why this one is failing. If I make the call a 2nd time, everything works, it is that first call that doesn't, and I have no idea why as I have used "UserApplicationViewBean" before that call.

                                Something definately seems amiss with 1.1 and injection

                                Any ideas on this one?
                                Thanks

                                • 13. Re: Value injection not always working with Seam 1.1
                                  andrew.rw.robinson

                                  A little more information. I found a work-around, but not sure why it works. The method:
                                  changeCurrentViewSelection(currentDimensionName, oldValue, newValue.getKey());

                                  Causes a seam event to be thrown and some other things. When that method returns my injected member variables are set to null despite the fact that I haven't left the method yet.

                                  I wonder if the following is happening:

                                  1) A fires event that B observes
                                  2) B calls method on A to get some information
                                  3) this method is finished, Seam sets A's member variables to null
                                  4) call context returns to A (after the event) and the members are null!

                                  If this is true, I believe the fix, would be that the member variables should never be set to null until the bean is no longer in "scope", meaning that no method is currently being invoked on that thread in that method.

                                  Could this be the issue?

                                  • 14. Re: Value injection not always working with Seam 1.1
                                    andrew.rw.robinson

                                    Please help! This is a crucial show stopping bug with 1.1. I am having null pointer exceptions all over my code (and not just with circular dependencies) because Seam keeps setting all of my member variables to null right in the middle of method calls!

                                    I haven't been able to pinpoint exactly what is causing it, but it always seems to happen when one bean calls another that has other beans injected.

                                    I'm not sure why the new version sets the members to null, but this is definately not "GA" stable code for us. Let me know what I can do to help troubleshoot this, but we need a solution ASAP as we are stuck needing functionality in 1.1 and only 1.0.1 is stable for us.