10 Replies Latest reply on Dec 19, 2008 6:05 PM by Aldo Bonzi

    selectOneMenu - I don't get it work

    Dirk Ho Newbie

      Hello,


      since approximately one week I try to get a selectOneMenu with data from the database work. But I always get errors.


      Here my Bean:



      @Stateful
      @Scope(EVENT)
      @Name("registerAction")
      
      public class RegisterAction implements Register {
              
              @Logger
              Log log;
              
              @In
              private Adresse adresse;
      
              @In
              private Bank bank;
              
              @In
              private Bankverbindung bankverbindung;
              
              @In
              private Login login;
              
              @In @Valid
              private Kunde kunde;
         
              @EJB
              private Benutzerverwaltung bv;
              
              @PersistenceContext
              private EntityManager em;
         
              @In
              private transient FacesContext facesContext;
         
              private String verify;
      
              public RegisterAction() {
      
              }
              
          public List<Anrede> anredeSelect() {
              List<Anrede> anreden = new ArrayList(bv.findAllAnreden());
              return anreden;
          }
      
         public String register() {
                 log.info(kunde.getAdresse() + "");
                 List<Kunde>  kunden = new ArrayList<Kunde>();
                 Anrede anrede = bv.findAnredeById(Long.valueOf(1));
                 log.info("BV: " + anrede);
                 bankverbindung.setBank(bank);
                 kunde.setAnrede(anrede);
                 kunde.setBankverbindung(bankverbindung);
                 kunde.setAdresse(adresse);
                 kunde.setLogin(login);
                 kunde.rolle = "kunde";
                 
                 Calendar calendar = new GregorianCalendar();
                 calendar.setTimeZone(TimeZone.getTimeZone("ECT"));
                 Date anmeldeDatum = calendar.getTime();
      
                 
                 kunde.setAnmeldeDatum(anmeldeDatum);
                 kunden.add(kunde);
                 
                 log.info("Kunde: " + kunde);
                 log.info("BV: " + bv);
                 
                 Collection<Kunde> tmp = null;     
                 try {
                         tmp = bv.createKunden(kunden);          
                 } catch(KundeDuplikatException kde) {
                         // TODO
                         System.out.println("!!! 1");
                         kde.printStackTrace();
                 } catch(KundeCreateAdresseException kcae) {
                         // TODO
                         System.out.println("!!! 2");
                         kcae.printStackTrace();
                         
                 } catch(Exception e) {
                         log.error(e.getMessage());
                         e.printStackTrace();
                 }
                 
                 
                 
                 facesContext.addMessage(null, new FacesMessage("ANREDE: " + anrede + " " + kunde + " ANSCHRIFT: " + adresse + " LOGIN: " + login + " BANK: " + bank + " BANKVERBINDUNG: " + bankverbindung));
                 return "a";
         }
      
         public String getVerify()
         {
            return verify;
         }
      
         public void setVerify(String verify)
         {
            this.verify = verify;
         }
      
         @Destroy @Remove
         public void destroy() {}
      }



      The method called in anredeSelect() returns a Collection<Anrede> with all available titles from the database.


      My register.xhtml looks like this:



      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                                   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <ui:composition xmlns:a4j="http://richfaces.org/a4j"
                                      xmlns="http://www.w3.org/1999/xhtml"
                      xmlns:s="http://jboss.com/products/seam/taglib"
                      xmlns:ui="http://java.sun.com/jsf/facelets"
                      xmlns:f="http://java.sun.com/jsf/core"
                      xmlns:h="http://java.sun.com/jsf/html"
                      xmlns:rich="http://richfaces.org/rich"
                      template="layout/template.xhtml">
      
      <ui:define name="body">
              <h:messages globalOnly="true" styleClass="message" id="globalMessages" />
              <h1>#messageswebsite.headline.register}</h1>
      
              <h:form id="register" styleClass="">
                      <h:selectOneMenu value="#{registerAction.anrede}">
                              <f:selectItems value="#{registerAction.anredeSelect()}" />
                      </h:selectOneMenu>
      </h:form>
      </ui:define>
      </ui:composition>



      If I deploy and call the register.seam, I get the error, that @In attributes may not be null. So, I comment all @In and I get the error message:




      21:20:54,621 ERROR [viewhandler] Error Rendering View[/register.xhtml]
      java.lang.IllegalArgumentException: Argument Error: An option for component j_id18 was not an instance of javax.faces.model.SelectItem.  Type found: java.util.ArrayList.
              at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:313)
              at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:810)
              at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:280)
              at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946)
              at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
              at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:204)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:150)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:379)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:506)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:73)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
              at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
              at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:566)
              at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
              at java.lang.Thread.run(Unknown Source)
      21:20:54,647 INFO  [STDOUT] Hibernate: 
          select
              anrede0_.anrede_id as anrede1_105_,
              anrede0_.anrede as anrede105_ 
          from
              public.anrede anrede0_




      What do I have to do to not get an error and to be able to use @In for this class (my formular is bigger, but I deleted all that it is not that huge for testing).


      It would be very kind, if you could help me!


      Thanks and best regards,


      Dirk

        • 1. Re: selectOneMenu - I don't get it work
          Amit Bafna Newbie

          Hey Dirk,


          I am assuming Anrede is an entity. You can probably try this:



          <h:selectOneMenu value="#{registerAction.anrede}">
               <s:convertEntity />
               <s:selectItems var="anrede" value="#{registerAction.anredeSelect()}" 
                  label="#{anrede.LABEL}" noSelectionLabel="Select Anrede..."/>
          </h:selectOneMenu>
          



          Alternatively, you will have to define the value to be returned as a collection of SelectItem(Object value, String label)


          Also, I dont see registerAction.anrede anywhere in your code. Is it something that you simply did not paste?



          Let me know if this helps.


          Cheers!!!


          Amit

          • 2. Re: selectOneMenu - I don't get it work
            Dirk Ho Newbie

            Hi Amit,


            thanks for your fast response! I just tried your JSF-Example and after that - you were right - I got this message:




            Caused by: javax.el.PropertyNotFoundException: /register.xhtml @18,51 value="#{registerAction.anrede}": Property 'anrede' not found on type org.javassist.tmp.java.lang.Object_$$_javassist_2




            I thought, I had declared registerAction.anrede by adding



            @In
            private Anrede anrede;
            
            or
            
            private Anrede anrede;



            to the Bean. How do I have to do that? All the other input field I can access this way.


            BTW: You are right, Anrede (in english Title - like Sir, Madam,..) is an Entity. My student college already declared a dataGrid what, in my mind, should be the same principle of usage?!?! But I cannot use this principle for the selectOneMenu.


            Hopefully you understood, what I mean - probably this is not the best english I told you.


            Thanks and best regards,


            Dirk

            • 3. Re: selectOneMenu - I don't get it work
              Dirk Ho Newbie

              <h:selectOneMenu value="#{registerAction.anrede}">
                      <s:convertEntity />
                      <s:selectItems var="anrede" value="#{registerAction.anredeSelect()}" 
                      label="#{anrede.LABEL}" noSelectionLabel="Select Anrede..."/>
              </h:selectOneMenu>
              




              Sorry, one more question that I even didn't understand in the Seam Documentation, yet:
              Is {anrede.LABEL} a link to an attribute of the entity anrede or is it something generated automatically? And what is the difference between selectOneMenu value and var ?
              Both are the attributes that will contain the selected value of the selectOneMenu, won't they?


              Thanks and best regards,


              Dirk

              • 4. Re: selectOneMenu - I don't get it work
                Amit Bafna Newbie

                Dirk,


                You need to declare a property named Anrede and its get/set methods to access from UI.



                private Anrede anrede;
                
                public Anrede getAnrede(){
                    return this.anreded;
                }
                
                public void setAnrede(Anrede anrede){
                    this.anrede = anrede;
                }
                


                As per label attribute, this is the property of entity that you want to display in the drop down like Sir, Madam etc. Or else, the drop will list an object.


                var is the variable that iterates over the collection defined for the value of s:selectItems. This attribute gives you access to individual entity from the collection that you can use for displaying the label (for e.g. anrede.title or some other property of anrede entity).


                Once an item is selected, the corresponding var value gets assigned to value of h:selectOneMenu i.e. registerAction.anrede


                You should check out seam documentation on s:selectItems for more details.


                Hope this helps.


                Cheers!!!


                Amit

                • 5. Re: selectOneMenu - I don't get it work
                  Dirk Ho Newbie

                  Hi Amit,


                  thanks for your help and your great description - my problem is, I think, that I'm not in practice in reading english specifications. So, I cannot understand words like label or something like that that easy, if I read it in Seam Documentation (I already read the hole Documentation and got lots of needul information out of it).


                  You were right, now, the selectOneMenu works - very big thanks for it!


                  BUT: It only works, if I comment the @In-attributes of my register page (on this page, people can register and it worked fine without the selectOneMenu (instead of the selectOneMenu I used a dummy where I got data out of the database instead of giving the user the possibility to select his title)).


                  If I use my @In-Attributes, I get the following message:



                  12:09:36,710 ERROR [viewhandler] Error Rendering View[/register.xhtml]
                  javax.faces.FacesException: javax.el.ELException: /register.xhtml @18,51 value="#{registerAction.anrede}": Error reading 'anrede' on type org.javassist.tmp.java.lang.Object_$$_javassist_2
                       at javax.faces.component.UIOutput.getValue(UIOutput.java:187)
                       at org.jboss.seam.ui.component.UISelectItems.getParentValue(UISelectItems.java:293)
                       at org.jboss.seam.ui.component.UISelectItems.isShowNoSelectionLabel(UISelectItems.java:256)
                       at org.jboss.seam.ui.component.UISelectItems.noSelectionLabel(UISelectItems.java:234)
                       at org.jboss.seam.ui.component.UISelectItems.getValue(UISelectItems.java:154)
                       at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:296)
                       at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:810)
                       at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:280)
                       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
                       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:946)
                       at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
                       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
                       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
                       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
                       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
                       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:204)
                       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
                       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                       at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:150)
                       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:379)
                       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:506)
                       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:73)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                       at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
                       at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:566)
                       at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
                       at java.lang.Thread.run(Unknown Source)
                  Caused by: javax.el.ELException: /register.xhtml @18,51 value="#{registerAction.anrede}": Error reading 'anrede' on type org.javassist.tmp.java.lang.Object_$$_javassist_2
                       at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
                       at javax.faces.component.UIOutput.getValue(UIOutput.java:184)
                       ... 63 more
                  Caused by: javax.ejb.EJBTransactionRolledbackException: @In attribute requires non-null value: registerAction.adresse
                       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
                       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
                       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
                       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
                       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                       at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
                       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
                       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
                       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
                       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
                       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                       at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
                       at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
                       at $Proxy1530.getAnrede(Unknown Source)
                       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 org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
                       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
                       at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
                       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
                       at org.jboss.seam.ejb.RemoveInterceptor.aroundInvoke(RemoveInterceptor.java:43)
                       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.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
                       at org.javassist.tmp.java.lang.Object_$$_javassist_2.getAnrede(Object_$$_javassist_2.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.getValue(BeanELResolver.java:62)
                       at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
                       at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
                       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 com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
                       ... 64 more
                  Caused by: org.jboss.seam.RequiredException: @In attribute requires non-null value: registerAction.adresse
                       at org.jboss.seam.Component.getValueToInject(Component.java:2232)
                       at org.jboss.seam.Component.injectAttributes(Component.java:1648)
                       at org.jboss.seam.Component.inject(Component.java:1466)
                       at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:34)
                       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                       at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
                       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                       at org.jboss.seam.persistence.EntityManagerProxyInterceptor.aroundInvoke(EntityManagerProxyInterceptor.java:29)
                       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                       at org.jboss.seam.persistence.HibernateSessionProxyInterceptor.aroundInvoke(HibernateSessionProxyInterceptor.java:31)
                       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.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
                       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 org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
                       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
                       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                       at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
                       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
                       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
                       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
                       ... 104 more
                  12:09:36,750 ERROR [lifecycle] JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /register.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@6ec0d9]
                  12:09:36,753 WARN  [ExceptionFilter] handling uncaught exception
                  javax.servlet.ServletException
                       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                       at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:150)
                       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:379)
                       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:506)
                       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:73)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                       at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
                       at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:566)
                       at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
                       at java.lang.Thread.run(Unknown Source)
                  Caused by: java.lang.NullPointerException
                       at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:168)
                       at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:147)
                       at com.sun.facelets.util.DevTools.debugHtml(DevTools.java:109)
                       at com.sun.facelets.FaceletViewHandler.handleRenderException(FaceletViewHandler.java:692)
                       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:660)
                       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:204)
                       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
                       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                       ... 43 more
                  12:09:36,753 WARN  [ExceptionFilter] exception root cause
                  java.lang.NullPointerException
                       at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:168)
                       at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:147)
                       at com.sun.facelets.util.DevTools.debugHtml(DevTools.java:109)
                       at com.sun.facelets.FaceletViewHandler.handleRenderException(FaceletViewHandler.java:692)
                       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:660)
                       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:204)
                       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
                       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                       at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:38)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:42)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:150)
                       at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                       at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:379)
                       at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:506)
                       at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:73)
                       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                       at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
                       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                       at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:856)
                       at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:566)
                       at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
                       at java.lang.Thread.run(Unknown Source)
                  12:09:36,754 WARN  [ExceptionFilter] running exception handlers
                  


                  What a pitty, I couldn't find a working class with a selectOneMenu - only the RichFaces-Descriptions for selectOneMenu (in Seam Docu).


                  Here is my class RegisterAction (in the interface Register I have prototypes for the getters and setters of all attribues):


                  @Stateful
                  @Scope(EVENT)
                  @Name("registerAction")
                  // TODO @Restrict("#{not identity.loggedIn}")
                  public class RegisterAction implements Register {
                       
                       @Logger
                       Log log;
                       
                       @In
                       private Adresse adresse;
                  
                       @In
                       private Bank bank;
                       
                       @In
                       private Bankverbindung bankverbindung;
                       
                       @In
                       private Login login;
                       
                       @In @Valid
                       private Kunde kunde;
                    
                       private Anrede anrede;
                       
                       @EJB
                       private Benutzerverwaltung bv;
                       
                       @PersistenceContext
                       private EntityManager em;
                     
                       @In
                       private transient FacesContext facesContext;
                     
                       private String verify;
                       
                       public RegisterAction() {
                  
                       }
                       
                      public List<Anrede> anredeSelect() {
                           ArrayList<Anrede> anreden = new ArrayList<Anrede>(bv.findAllAnreden());
                           return anreden;
                      }
                  
                     public String register() {
                          log.info(kunde.getAdresse() + "");
                          List<Kunde> kunden = new ArrayList<Kunde>();
                             // Dummy I used instead of selectOneMenu
                          //Anrede anrede = bv.findAnredeById(Long.valueOf(1));
                          log.info("BV: " + anrede);
                          bankverbindung.setBank(bank);
                          kunde.setAnrede(anrede);
                          kunde.setBankverbindung(bankverbindung);
                          kunde.setAdresse(adresse);
                          kunde.setLogin(login);
                          kunde.setRolle("kunde");
                          
                          Calendar calendar = new GregorianCalendar();
                          calendar.setTimeZone(TimeZone.getTimeZone("ECT"));
                          Date anmeldeDatum = calendar.getTime();
                  
                          
                          kunde.setAnmeldeDatum(anmeldeDatum);
                          kunden.add(kunde);
                          
                          log.info("Kunde: " + kunde);
                          log.info("BV: " + bv);
                          
                          Collection<Kunde> tmp = null;        
                          try {
                               tmp = bv.createKunden(kunden);        
                          } catch(KundeDuplikatException kde) {
                               kde.printStackTrace();
                          } catch(KundeCreateAdresseException kcae) {
                               kcae.printStackTrace();
                          } catch(Exception e) {
                               log.error(e.getMessage());
                               e.printStackTrace();
                          }
                          
                          
                          
                          facesContext.addMessage(null, new FacesMessage("ANREDE: " + anrede + " " + kunde + " ANSCHRIFT: " + adresse + " LOGIN: " + login + " BANK: " + bank + " BANKVERBINDUNG: " + bankverbindung));
                          return "a";
                       }
                     
                       public void setAnrede(Anrede a) {
                          this.anrede = a;
                       }
                     
                       public Anrede getAnrede() {
                          return this.anrede;
                       }
                     
                       public void setKunde(Kunde k) {
                          this.kunde = k;
                       }
                     
                       public Kunde getKunde() {
                          return this.kunde;
                       }
                     
                       public void setLogin(Login l) {
                          this.login = l;
                       }
                     
                       public Login getLogin() {
                          return this.login;
                       } 
                       
                       public void setAdresse(Adresse a) {
                            this.adresse = a;
                       }
                          
                       public Adresse getAdresse() {
                            return this.adresse;
                       }
                       
                       public void setBank(Bank b) {
                            this.bank = b;
                       }
                          
                       public Bank getBank() {
                            return this.bank;
                       } 
                       
                       public void setBankverbindung(Bankverbindung b) {
                            this.bankverbindung = b;
                       }
                          
                       public Bankverbindung getBankverbindung() {
                            return this.bankverbindung;
                       }      
                  
                       public String getVerify() {
                        return verify;
                       }
                  
                       public void setVerify(String verify) {
                        this.verify = verify;
                       }
                  
                       @Destroy @Remove
                       public void destroy() {}
                  }
                  



                  I think, if I have one working class with selectOneMenu, it will be not that hard to create new sites including selectOneMenu,.. and I also have a class having the right Seam-Structure.


                  If you could help me one more time, it would be very kind - I think it's great to get such fast and professional help (in german forums this is, what a pitty, not the reason).


                  Thanks and best regards,


                  Dirk

                  • 6. Re: selectOneMenu - I don't get it work
                    Mikael Andersson Master

                    Hi


                    In the stack trace it says that it requires a non-null value. That means that it wants what you are trying to inject with @In to exist so it has something to inject.


                    If the object doesn't exist it needs to be created and you can ask Seam to do this by using the following : @In(create=true).


                    But perhaps you shouldn't inject it if it hasn't been created somewhere else? If it is only used withing the context of that backing bean then it might as well be a property of that bean.


                    Another thing, you might want to use a scope which is longer than EVENT since the data won't be available when the page is submitted. Perhpas CONVERSATION or the awesome PAGE scope.


                    Hope it helps,
                    micke

                    • 7. Re: selectOneMenu - I don't get it work
                      Dirk Ho Newbie

                      Hi micke,


                      thanks for your reply! If I use @In(create=true) or only use attributes, I get the formular work, but, if I want to send my registration, I get an exception


                      Exception during request processing: 
                      Caused by javax.servlet.ServletException with message: "EntityManager is closed"



                      and



                      Caused by java.lang.IllegalStateException with message: "EntityManager is closed"



                      I now read the API of interface EntityManager and found the IllegalStateException, but I don't know what to do to keep em working. I commented @PersistenceContext private EntityManger em in my Action-Method but the error occured again. So, I think, this error results out of my DAO and/or my application tier(don't know if this is the right word in english), where I also have @PersistenceContent private EntityManager em.


                      In my Action class I changed the Scope to Conversation and I also did so, after the error, in my DAO and Application Tier, but it didn't work...


                      Thanks and best regards,


                      Dirk


                      • 8. Re: selectOneMenu - I don't get it work
                        Amit Bafna Newbie

                        Dirk,


                        Did you add @In(create=true) on all the properties or on entity manager? Stack trace you listed shows seam could not find adresse, when you tried to inject it.


                        Caused by: org.jboss.seam.RequiredException: @In attribute requires non-null value: registerAction.adresse
                        


                        Remember, there should be a seam component present with name adresse. Either you can add create=true at the time of injection or add @AutoCreate annotation on seam component. If you add @AutoCreate, you will not have to explicitly create the seam component, every time you want to use it via bijection.


                        Cheers!!!


                        Amit

                        • 9. Re: selectOneMenu - I don't get it work
                          Dirk Ho Newbie

                          Hi Amit,


                          thanks for your reply! The answered problem didn't exist after micke answered. Sorry! I changed all @In-attributes to normal attributes with getter and setter like private Adresse adresse,...


                          But after I did it and the displaying of my formular worked correct (selectOneMenu worked and there was no error when I started the page), I got the exception, that EntityManager is closed (posted one post over yours).


                          I think, this comes from the DAO class (BenutzerverwaltungDAOImpl.java) or the Application Tier (BenutzerverwaltungImpl.java). But I don't know, how I can reopen it or keep it open...
                          I did't found an answer on Interface EntityManager API page.


                          BenutzerverwaltungImpl.java:


                          @Stateless
                          @Scope(CONVERSATION)
                          @Name("bv")
                          @Local(Benutzerverwaltung.class)
                          public class BenutzerverwaltungImpl implements Benutzerverwaltung {
                               @Logger
                               Log log;
                               
                               @PersistenceContext
                               private EntityManager em;
                               
                               @EJB
                               private BenutzerverwaltungDao dao = getBenutzerverwaltungDao();
                               
                          // My Methods ...



                          BenutzerverwaltungDAOImpl


                          @Stateless
                          @Scope(CONVERSATION)
                          @Name("bvDAOImpl")
                          @Local(BenutzerverwaltungDao.class)
                          final public class BenutzerverwaltungDaoImpl implements BenutzerverwaltungDao {
                          
                               @Logger
                               Log log;
                               
                               @PersistenceContext
                               private EntityManager em;
                          
                          // My Methods ...



                          Is there an error in these methods? I tried changing Scope to Conversation because I got the recommendation from micke above and I already changed it in my Action-Class.


                          Thanks and best regards,


                          Dirk


                          • 10. Re: selectOneMenu - I don't get it work
                            Aldo Bonzi Novice

                            Just for curiosity, why are you mixing a @Scope(CONVERSATION) and a @Stateless annotation in a component?
                            Maybe a @Stateful is more suitable for your session beans.