1 2 Previous Next 21 Replies Latest reply on Nov 24, 2008 1:34 PM by etirk

    Property 'statusMessages' not found on type org.jboss.seam.Namespace

    nimo22

      I got the following stacktrace when I bind a UIComponent. It does not matter in which SCOPE, the error is the same:



      08:38:39,409 ERROR [ExceptionFilter] exception root cause
      javax.el.ELException: /main.xhtml @33,138 binding="#{seamBean.name}": Error writing 'name' on type com.Main_$$_javassist_3
           at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:101)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:244)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:249)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:249)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:249)
           at com.sun.faces.lifecycle.RestoreViewPhase.doPerComponentActions(RestoreViewPhase.java:249)
           at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:193)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
           at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      ...
      Caused by: javax.el.PropertyNotFoundException: Property 'statusMessages' not found on type org.jboss.seam.Namespace
           at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
           at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
           at javax.el.BeanELResolver.property(BeanELResolver.java:279)
           at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
           at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
           at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
           at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
           at org.jboss.seam.Component.getInstanceFromFactory(Component.java:2015)
           at org.jboss.seam.Component.getInstance(Component.java:1962)
           at org.jboss.seam.Component.getInstance(Component.java:1939)
           at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2295)
           at org.jboss.seam.Component.getValueToInject(Component.java:2247)
           at org.jboss.seam.Component.injectAttributes(Component.java:1697)
           at org.jboss.seam.Component.inject(Component.java:1515)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.boewe.view.CreateUserView_$$_javassist_3.setLogin(CreateUserView_$$_javassist_3.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at javax.el.BeanELResolver.setValue(BeanELResolver.java:108)
           at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:68)
           at com.sun.faces.el.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:93)
           at org.jboss.el.parser.AstPropertySuffix.setValue(AstPropertySuffix.java:73)
           at org.jboss.el.parser.AstValue.setValue(AstValue.java:84)
           at org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
           at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:93)
           ... 51 more


        • 1. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
          blabno

          Got setters and getters for name property in both class and interface (if it is an ejb) ?

          • 2. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
            nimo22

            I have a EJB-Project, but this bean is integrated in an


            WEB_INF/classes



            WAR file and has no interface.


            The bean is a kind of seam managed backingBean, that means I have not assign the bean via faces-config.xml, but via @Name-Annotation.


            Have I forgotten anything?


            Look at my bean stored in my WAR-File:



            @Name("view")
            @Scope(CONVERSATION)
            public class ViewBean  {
            
            private UIInput name;
            
            //getter/setter
            
            @Begin(join = true)
            public void init() {
            name= new UIInput();
                      }
            
            @End
            public void save() {
            
            String actualName= (String) name.getValue();
            }
            }
            



            And my xhtml:


            <s:label value="login"/>
            <h:inputText binding="#{view.name}"/>
            



            Now, I get this error:


            javax.el.PropertyNotFoundException: /main.xhtml @33,132 binding="#{view.name}": Target Unreachable, identifier 'userView' resolved to null



            Any Ideas?





            • 3. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
              nimo22

              Sorry, the last stacktrace does not match. I get this error:



              javax.el.PropertyNotFoundException: /main.xhtml @33,132 binding="#{view.name}": Target Unreachable, identifier 'view' resolved to null



              That means, the seam-managed-bean is not findable. Do I need a extra lib for seam in my Web-Inf/lib ?

              • 4. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                nimo22

                The strange thing is, when I take that view:


                <s:label value="name"/>
                <h:inputText value="#{view.name}"/>
                
                <h:commandButton value="ShowName" action="#{view.show}" immediate="true"/>
                



                and reference this to that Bean:


                @Name("view")
                @Scope(CONVERSATION)
                public class ViewBean  {
                
                @In
                private FacesMessages facesMessages;
                
                private String name;
                
                //getter/setter
                
                @Begin(join = true)
                public void init() {
                name= "Enter Name";
                          }
                
                @End
                public void save() {
                
                 facesMessages.add("actual Name #0",getName());
                }
                }



                then, after pressing the button save, the message actual Name null occurs, even the instance has a value. What is wrong?






                • 5. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                  blabno

                  Read this excellent article on JSF lifecycle. This will explain it.

                  • 6. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                    blabno

                    BTW. Have you solved the problem with resolving components ? It is always nice to share what was wrong and how to fix it.
                    As to your immediate question. Because your button has immediate attribute the action will take place during apply request values phase. This is before update model values phase which means values on your backing bean are not set yet.
                    One solution to this is remove immediate attribute from button or putting immediate in h:inputText.

                    • 7. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                      nimo22

                      Hello Bernard,


                      now I know what is the failure, but I do not know, how I can handle that:


                      The problem was the injection of


                      @In
                      private FacesMessages facesMessages;


                      When I delete this, than all works well and I can obtain the values from the components via value or binding.


                      Is there something to know, when using facesMessages in a non EJB-Component? I have a sessionBean and there the facesMessages works well, but in my ViewBean it does not. Should I use a facesMessages-Factory instead of @In? I dont think so. Any ideas?

                      • 8. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                        nimo22

                        Hello Bernard,


                        now I know what is the failure, but I do not know, how I can handle that:


                        The problem was the injection of


                        @In
                        private FacesMessages facesMessages;


                        When I delete this, than all works well and I can obtain the values from the components via value or binding.


                        Is there something to know, when using facesMessages in a non EJB-Component? I have a sessionBean and there the facesMessages works well, but in my ViewBean it does not. Should I use a facesMessages-Factory instead of @In? I dont think so. Any ideas?

                        • 9. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                          nimo22

                          This is the stacktrace which occurs after injecting a facesMessages in my ViewBean via



                          @In private FacesMessages facesMessages;




                          I commented out all my


                          facesMessages.info(...);




                          in my ViewBean, only to show that the failure will occurs, even if I inject the facesMessages.



                          Caused by: javax.el.PropertyNotFoundException: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                               at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
                               at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
                               at javax.el.BeanELResolver.property(BeanELResolver.java:279)
                               at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
                               at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
                               at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
                               at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
                               at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
                               at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
                               at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
                               at org.jboss.seam.Component.getInstanceFromFactory(Component.java:2015)
                               at org.jboss.seam.Component.getInstance(Component.java:1962)
                               at org.jboss.seam.Component.getInstance(Component.java:1939)
                               at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2295)
                               at org.jboss.seam.Component.getValueToInject(Component.java:2247)
                               at org.jboss.seam.Component.injectAttributes(Component.java:1697)
                               at org.jboss.seam.Component.inject(Component.java:1515)
                               at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                               at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                               at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                               at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                               at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
                               at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
                               at com.boewe.view.myPhaseProber_$$_javassist_3.setInputBinding(myPhaseProber_$$_javassist_3.java)
                               at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                               at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                               at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                               at java.lang.reflect.Method.invoke(Unknown Source)
                               at javax.el.BeanELResolver.setValue(BeanELResolver.java:108)
                               at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:68)
                               at com.sun.faces.el.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:93)
                               at org.jboss.el.parser.AstPropertySuffix.setValue(AstPropertySuffix.java:73)
                               at org.jboss.el.parser.AstValue.setValue(AstValue.java:84)
                               at org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
                               at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:93)
                               ... 49 more






                          • 10. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                            blabno

                            Very strange. Show your stack trace when FacesMessages attribute annotated with @In is in  your bean.


                            BTW. post also your bean source cause I do not know if you use ui binding. I've read that conversational components cannot have ui binding.

                            • 11. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                              blabno

                              I guess this is some misconfiguration problem. Send me your project and I will debug it.
                              s4237 at pjwstk dot edu dot pl

                              • 12. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                                nimo22

                                Hello,


                                I solved this problem by using the standard JSF-MessageFactory.



                                FacesContext context = FacesContext.getCurrentInstance();
                                FacesMessage message = new FacesMessage("hello");
                                context.addMessage(null, message);



                                Now, all works well, without the @In private FacesMessages facesMessages;


                                I really do not know, why I can use Seam-facesMessages only in SessionBeans and not in POJOs. I know, that there are binding-issues with conversations-scope, but this is not the problem as I changed the scope to SESSION trying to find the error. The error is the this line:



                                @In private FacesMessages facesMessages;




                                Caused by: javax.el.PropertyNotFoundException: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                                     at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)



                                I use SEAM 2.1 and my project was setup via seam-gen. The only difference what I made is, that I store the non-sessionBeans in my WAR-File instead of my EAR as it is view-related logic.







                                • 13. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                                  blabno

                                  Hey ! Now I do not understand anything ! I've tried putting JavaBean component to WEB-INF/classes while whole app was EAR. Seam did not even find that component. How come it found yours ?

                                  • 14. Re: Property 'statusMessages' not found on type org.jboss.seam.Namespace
                                    nimo22

                                    At first make sure, that your POJO in Web-INF/classes has a @Name-Annotation


                                    @Name(javaBean)
                                    public class viewBean {..}


                                    Second, do the relevant changes in the build.xml to store this bean in the WEB-Inf/classes directory.


                                    Third, reference the Seam-Managed-Bean in your view or elsewhere via javeBean.


                                    That s it.



                                    1 2 Previous Next