6 Replies Latest reply on Oct 2, 2007 6:58 PM by Samuel Doyle

    What the heck!!!!????

    Samuel Doyle Apprentice

      I'm really starting to lose faith in Seam as I go beyond the simple tutorials and examples.

      javax.el.PropertyNotFoundException: /notificationAdmin.xhtml @50,99
      value="#{notificationManager.agencyIncidentTypes}": The
      class 'org.javassist.tmp.java.lang.Object_$$_javassist_1' does not have
      the property 'agencyIncidentTypes'.
      


      And clearly notificationManager does!!

      @Stateful
      @Name("notificationManager")
      @Scope(ScopeType.CONVERSATION)
      @Restrict("#{s:hasRole('ultra-user')}")
      public class NotificationManagerBean
       implements NotificationManagerLocal {
      
       @DataModel
       private List<Agency> agencies;
      
       @EJB
       private AgencyFacadeLocal agencyFacade;
      
       @Out(scope=ScopeType.CONVERSATION)
       private List<IncidentType> agencyIncidentTypes =
       new ArrayList<IncidentType>();
      
       /** Creates a new instance of NotificationManagerBean */
       public NotificationManagerBean() {
       }
      
       @Begin(join=true) // Start the conversation.
       @Factory("agencies") // for #{agencies} as done now
       public void factoryAgencies()
       {
       this.agencies =
       agencyFacade.findAll();
       }
      
       public void getAgencyIncidentTypes( Agency selectedAgency )
       {
       this.agencyIncidentTypes = selectedAgency.getAgencyIncidentTypes();
       }
      
       // Ends the conversation via cancel operation.
       @End
       public void cancel() {}
      
       // Ends the conversation via the apply operation.
       @End
       public void apply() {}
      
       @Remove
       public void destroy() {}
      
      }
      


      Here is the xhtml
      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition 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.ajax4jsf.org/rich"
       xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
       xmlns:c="http://java.sun.com/jstl/core"
       template="layout/template3col.xhtml">
      
       <h:messages globalOnly="true" styleClass="message"/>
      
       <ui:param name="activeTab" value="NotificationAdmin"/>
      
      
       <ui:define name="leftsidebar">
       <rich:panel>
       <h:form>
       <rich:dataTable id="agencies"
       var="agency" value="#{agencies}">
      
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column>
       <h:outputText value="Agency Name" />
       </rich:column>
       </rich:columnGroup>
       </f:facet>
      
       <rich:column>
       <a4j:commandLink type="submit"
       value="#{agency.agencyName}"
       reRender="incidenttypes"
       action="#{notificationManager.getAgencyIncidentTypes(agency)}"/>
       <!-- s:link action="#{notificationManager.getAgencyIncidentTypes(agency)}" value="#{agency.agencyName}"/ -->
       <!-- h:outputText value="#{agency.agencyName}" / -->
       </rich:column>
      
       </rich:dataTable>
       </h:form>
       </rich:panel>
       </ui:define>
      
       <ui:define name="content">
       <rich:panel>
       <h:form>
       <rich:dataTable id="incidenttypes"
       var="incidentType" value="#{notificationManager.agencyIncidentTypes}">
      
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column>
       <h:outputText value="Incident Type" />
       </rich:column>
       </rich:columnGroup>
       </f:facet>
      
       <rich:column>
       <h:outputText value="#{incidentType.description}" />
       </rich:column>
      
       </rich:dataTable>
       </h:form>
       </rich:panel>
       </ui:define>
      
       <ui:define name="rightsidebar">
       </ui:define>
      
      </ui:composition>
      


        • 1. Re: What the heck!!!!????
          Brian Smith Apprentice

          Is the getter defined on your Local interface?

          • 2. Re: What the heck!!!!????
            Jacob Orshalick Apprentice

            No it doesn't actually. You have:

            public void getAgencyIncidentTypes( Agency selectedAgency )
             {
             this.agencyIncidentTypes = selectedAgency.getAgencyIncidentTypes();
             }
            


            which is not the same as #{notificationManager.agencyIncidentTypes}. This requires an actual getter for agencyIncidentTypes. Did you clip this before posting?

            Also, why are you going through the notificationManager to retrieve agencyIncidentTypes? You outject agencyIncidentTypes which makes them directly available to the view through #{agencyIncidentTypes}. Hope that helps.

            • 3. Re: What the heck!!!!????
              steve tynor Novice

              Though named as a getter, your getter has the interface of a setter. try changing it from:

               public void getAgencyIncidentTypes( Agency selectedAgency )
               {
               this.agencyIncidentTypes = selectedAgency.getAgencyIncidentTypes();
               }
              

              to
               public Agency getAgencyIncidentTypes()
               {
               return selectedAgency.getAgencyIncidentTypes();
               }


              Keep the faith!


              • 4. Re: What the heck!!!!????
                Samuel Doyle Apprentice

                 

                "smithbstl" wrote:
                Is the getter defined on your Local interface?


                No I do not have a defined getter in the Local but the

                @DataModel
                private List agencies;

                which is implied @Out does not either and it works.

                S.D.

                • 5. Re: What the heck!!!!????
                  Brian Smith Apprentice

                  See the above two post by Jacob and tynor, they have the solution. But you will also need it defined on your local interface for the SFSB. The reason the @DataModel works is because you are referring to it directly as a Seam component. It is NOT a method. All public methods of Seam components (ie your stateful and stateless beans) need to be declared in local interfaces. This is required by Seam (and by the EJB spec)

                  • 6. Re: What the heck!!!!????
                    Samuel Doyle Apprentice

                    Thanks everyone for your help, this week has been a flurry of things going wrong =/.

                    S.D.