1 2 3 Previous Next 36 Replies Latest reply on Jun 21, 2006 5:02 AM by Rod Smith

    @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.0.0

    Jens Weintraut Apprentice

      Hi,

      after a one-day-odyssey I'm wondering if anybody encountered this problem before I did. A search in this forum shows, that nobody had problems regarding a tomahawk dataTable with the new JBoss AS and Seam versions.

      I updated to

      JBoss Eclipse IDE 1.6.0 GA (because it knows what's the JBoss AS library like)
      JBoss AS 4.0.4 GA
      JBoss Seam 1.0.0 CR3 (BTW: why is it called CR, and not RC anymore?)
      Apache myFaces Core 1.1.3
      Apache myFaces Tomahawk 1.1.2
      the new facelets version included in the booking demo (I think it's 1.0.14)



      Some weeks ago I followed the http://wiki.jboss.org/wiki/Wiki.jsp?page=DataModelWithTomahawkDataTable. It worked very well. I could also use it with inheritance (the superclass holds the list, the @DataModelSelection and the @DataModelSelectionIndex; the sub-classes provide different @DataModel and @Factory methods; works fine).

      But now, when I deploy, Seam tells me that I'm using multiple @DataModelSelection fields.

      Console wrote:
      15:43:03,265 ERROR [[/ares]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      java.lang.IllegalStateException: Multiple @DataModelSelection fields for: testactionsForValidator
      at org.jboss.seam.Component.initMembers(Component.java:476)
      at org.jboss.seam.Component.<init>(Component.java:185)
      at org.jboss.seam.Component.<init>(Component.java:151)
      at org.jboss.seam.Component.<init>(Component.java:146)
      at org.jboss.seam.Component.<init>(Component.java:141)
      at org.jboss.seam.init.Initialization.addComponent(Initialization.java:290)
      ....


      I don't know why. I didn't change the code (OK, I removed all the @Interceptors) and every component only holds one @DataModelSelection field:

      public class SearchTestactionAction implements Serializable, SearchTestaction {
       @PersistenceContext(unitName = "aresDatabase")
       private EntityManager em;
      
       @In(required=false)
       private Testaction testaction;
      
       private List<Testaction> foundTestactions;
       @DataModelSelection
       @Out(required=false, scope=ScopeType.SESSION)
       private Testaction foundTestaction;
       @DataModelSelectionIndex
       private int foundTestactionIndex;
      
       @In(required=false)
       private Release selectedRelease;
      
       private String sortColumn = "id";
       private boolean ascending = true;
      
       @Factory("foundTestactions")
       public String search() {
       // ... omitted ... //
       Collections.sort(foundTestactions, new TestactionComparator(sortColumn, ascending));
      
       return "search";
       }
      
       @DataModel
       public List<Testaction> getFoundTestactions() {
       return foundTestactions;
       }
      
       // ... omitted ... //
      
       public boolean isAscending() {
       return ascending;
       }
      
       public void setAscending(boolean ascending) {
       if (ascending!=this.ascending) {
       foundTestactions = null;
       }
       this.ascending = ascending;
       }
      
       public String getSortColumn() {
       return sortColumn;
       }
      
      // ... omitted ... //
      
       @Remove @Destroy
       public void destroy() {
       }
      }


      Would be nice, if someone could post a hint ...

      Regards
      Newlukai

        • 1. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
          Gavin King Master

          Why do you think the message is related to that component? Seems to be some other component is the source of the problem.

          • 2. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
            Jens Weintraut Apprentice

             

            "gavin.king@jboss.com" wrote:
            Why do you think the message is related to that component? Seems to be some other component is the source of the problem.


            Hmm. OK. Sorry. But every component in my project uses this way to provide a list which is displayed by the tomahawk dataTable. And every such component causes this error:

            Console wrote:
            08:45:10,546 INFO [Component] Component: searchTestaction, scope: SESSION, type: STATEFUL_SESSION_BEAN, class: com.idsscheer.ares.sessions.SearchTestactionAction, JNDI: ares/SearchTestactionAction/local
            08:45:10,562 ERROR [[/ares]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
            java.lang.IllegalStateException: Multiple @DataModelSelection fields for: foundTestactions


            Which component causes the error is only a matter of which component is loaded first.

            But here is the component which is mentioned in the first error message:
            @Stateful
            @Scope(ScopeType.SESSION)
            @LoggedIn
            @Name("testactionValidator")
            public class TestactionValidatorAction extends TestactionHandling implements Serializable, TestactionValidator {
             @In(required=false)
             private Release selectedRelease;
            
             private Long lastSelectedReleaseID;
            
             @Factory("testactionsForValidator")
             public void initTestactions() {
             // start a query to put some data into testactions
             Collections.sort(testactions, new TestactionComparator(column, ascending));
             }
            
             @DataModel(scope=ScopeType.PAGE)
             public List<Testaction> getTestactionsForValidator() {
             initTestactions();
             return testactions;
             }
            
             // ... omitted ... //
            }


            and its superclass:
            //has no annotations
            public class TestactionHandling {
             @PersistenceContext(unitName = "aresDatabase")
             protected EntityManager em;
            
             @In @Valid
             protected User user;
            
             @In
             protected FacesContext facesContext;
            
             protected List<Testaction> testactions;
             @DataModelSelectionIndex
             protected int testactionIndex;
             @DataModelSelection
             protected Testaction testaction;
            
             @In(required=false)
             @Out(required=false, scope=ScopeType.SESSION)
             protected Testaction currentTestaction;
            
             protected List<Testaction> currentTestactions;
             protected int currentTestactionIndex;
            
             protected String column = "id";
             protected boolean ascending = true;
            
             private ResourceBundle resourceBundle;
            
             private long lastRefreshTime;
             private final long REFRESH_PERIOD = 60000; //1 Minute
            
             // ... omitted ... //
            
             public boolean isAscending() {
             return ascending;
             }
            
             public void setAscending(boolean ascending) {
             if(ascending != this.ascending) {
             testactions = null;
             }
             this.ascending = ascending;
             }
            
             public String getColumn() {
             return column;
             }
            
             public void setColumn(String column) {
             if(!column.equals(this.column)) {
             testactions = null;
             }
             this.column = column;
             }
            
             // ... omitted ... //
            
             @Remove @Destroy
             public void destroy() {
             }
            
             // ... omitted ... //
            }


            I didn't post the error causing component, because it's a subclass and its superclass holds the @DataModelSelection and the @DataModelSelectionIndex, but the inheritance doesn't cause the error. So I wanted to prevent any posts which tell me not to use inheritance ;)

            If there are further questions, just ask.

            • 3. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
              Hagen Schink Newbie

              Hi,

              I've got the same error. On my way to find the real problem I comment every appearance of the DataModel-annotation. After that the ear deployed but when I tried to start my app I get another error-message.

              11:37:27,643 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
              11:37:28,144 INFO [HtmlRenderKitImpl] Overwriting renderer with family = javax.faces.Command rendererType = javax.faces.Button renderer class = org.apache.myfa
              ces.renderkit.html.jsf.DummyFormHtmlButtonRenderer
              11:37:28,154 INFO [HtmlRenderKitImpl] Overwriting renderer with family = javax.faces.Command rendererType = javax.faces.Link renderer class = org.apache.myface
              s.renderkit.html.jsf.DummyFormHtmlLinkRenderer
              11:37:28,204 WARN [AbstractSeamPhaseListener] There should only be one Seam phase listener per application
              11:37:28,204 INFO [StartupServletContextListener] ServletContext 'D:\ApplicationServer\jboss-4.0.4.GA\server\default\.\tmp\deploy\tmp41043kam.ear-contents\kam-
              web-exp.war\' initialized.
              11:37:28,214 WARN [ExtensionsFilter] Please adjust your web.xml to use org.apache.myfaces.webapp.filter.ExtensionsFilter
              11:37:28,234 INFO [EARDeployer] Started J2EE application: file:/x:/kam.ear
              12:11:59,866 ERROR [PhaseListenerManager] Exception in PhaseListener RESTORE_VIEW 1 afterPhase
              java.lang.NullPointerException
               at org.jboss.seam.contexts.PageContext.getAttributeMap(PageContext.java:103)
               at org.jboss.seam.contexts.PageContext.<init>(PageContext.java:40)
               at org.jboss.seam.contexts.Lifecycle.resumePage(Lifecycle.java:326)
               at org.jboss.seam.jsf.AbstractSeamPhaseListener.restoreAnyConversationContext(AbstractSeamPhaseListener.java:39)
               at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:63)
               at org.jboss.seam.jsf.SeamTransactionManagedPersistencePhaseListener.afterPhase(SeamTransactionManagedPersistencePhaseListener.java:65)
               at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
               at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:181)
               at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
               at javax.faces.webapp.FacesServlet.service(Unknown Source)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
               at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
               at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
               at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
               at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:315)
               at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
               at java.lang.Thread.run(Unknown Source)
              12:12:00,237 ERROR [PhaseListenerManager] Exception in PhaseListener RESTORE_VIEW 1 afterPhase
              java.lang.NullPointerException
               at org.apache.myfaces.renderkit.html.util.AutoScrollPhaseListener.afterPhase(AutoScrollPhaseListener.java:52)
               at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:89)
               at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:181)
               at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
               at javax.faces.webapp.FacesServlet.service(Unknown Source)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
               at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
               at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
               at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
               at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:315)
               at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
               at java.lang.Thread.run(Unknown Source)
              12:12:00,577 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
              java.lang.AbstractMethodError: javax.faces.context.FacesContext.getELContext()Ljavax/el/ELContext;
               at javax.faces.component.UIViewRoot.setLocale(Unknown Source)
               at org.apache.myfaces.application.jsp.JspViewHandlerImpl.createView(JspViewHandlerImpl.java:130)
               at org.jboss.seam.jsf.SeamViewHandler.createView(SeamViewHandler.java:43)
               at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.createView(JspTilesViewHandlerImpl.java:305)
               at org.apache.myfaces.lifecycle.LifecycleImpl.restoreView(LifecycleImpl.java:144)
               at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:66)
               at javax.faces.webapp.FacesServlet.service(Unknown Source)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
               at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
               at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
               at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
               at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:315)
               at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
               at java.lang.Thread.run(Unknown Source)
              12:12:00,888 WARN [FormAuthenticator] Unexpected error forwarding to login page
              javax.servlet.ServletException: Servlet execution threw an exception
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:275)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
               at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
               at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
               at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
               at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
               at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:315)
               at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243)
               at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
               at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
               at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
               at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
               at java.lang.Thread.run(Unknown Source)
              


              I think that multiple PhaseListener are the real problem behind that Multiple @DataModelSelection failure, but on the one hand I'm not sure and on the other hand I don't know how to find and shut down the other PhaseListener to prove that.

              • 4. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                Gavin King Master

                That is not the same error as the original post.

                And yes, it lookes like you have multiple phase listeners. Check your JSF startup log.

                • 5. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                  Hagen Schink Newbie

                   

                  "gavin.king@jboss.com" wrote:
                  That is not the same error as the original post.

                  And yes, it lookes like you have multiple phase listeners. Check your JSF startup log.


                  Ok, I tried some other things. I thougt that multiple jar's are the cause for the problem, but my actions have no effects. Where is this JSF startup log located you mentioned? I searched the normal server.log, but there seems to be no hint.

                  I'll open a extra thread when I can't solve the problem the next time because it becomes to much.


                  • 6. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                    Jens Weintraut Apprentice

                    And what's with the original post? Should I remove all @DataModel anntotation s (and then remove @DataModelSelection and @DataModelSelectionIndex as well?)? Or is there another workaround, is it a bug or did I make a mistake?

                    • 7. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                      Hagen Schink Newbie

                       

                      "Newlukai" wrote:
                      And what's with the original post? Should I remove all @DataModel anntotation s (and then remove @DataModelSelection and @DataModelSelectionIndex as well?)? Or is there another workaround, is it a bug or did I make a mistake?


                      I dont't think that this can be the solution, the annotation is to important. But I think that this is maybe a config-mistake.

                      Here my web.xml:
                      <?xml version="1.0"?>
                      <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
                       version="2.4">
                      
                       <!-- Tiles -->
                       <context-param>
                       <param-name>tiles-definitions</param-name>
                       <param-value>/WEB-INF/tiles.xml</param-value>
                       </context-param>
                      
                       <context-param>
                       <description>
                       State saving method: "client" or "server" (= default)
                       See JSF Specification 2.5.2
                       </description>
                      
                       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                       <param-value>client</param-value>
                       </context-param>
                      
                       <context-param>
                       <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
                       <param-value>true</param-value>
                       </context-param>
                      
                       <context-param>
                       <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
                       <param-value>true</param-value>
                       </context-param>
                      
                       <context-param>
                       <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
                       <param-value>false</param-value>
                       </context-param>
                      
                       <context-param>
                       <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
                       <param-value>true</param-value>
                       </context-param>
                      
                       <!-- Faces Servlet -->
                       <servlet>
                       <servlet-name>Faces Servlet</servlet-name>
                       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                       <load-on-startup>1</load-on-startup>
                       </servlet>
                      
                       <servlet-mapping>
                       <servlet-name>Faces Servlet</servlet-name>
                       <url-pattern>*.jsf</url-pattern>
                       </servlet-mapping>
                      
                       <!-- Welcome files -->
                       <welcome-file-list>
                       <welcome-file>index.jsp</welcome-file>
                       </welcome-file-list>
                      
                      
                       <!-- Tomahawk -->
                       <filter>
                       <filter-name>MyFacesExtensionsFilter</filter-name>
                       <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
                       <init-param>
                       <param-name>maxFileSize</param-name>
                       <param-value>20m</param-value>
                       </init-param>
                       </filter>
                      
                       <filter-mapping>
                       <filter-name>MyFacesExtensionsFilter</filter-name>
                       <url-pattern>*.jsf</url-pattern>
                       </filter-mapping>
                      
                       <filter-mapping>
                       <filter-name>MyFacesExtensionsFilter</filter-name>
                       <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
                       </filter-mapping>
                      
                      
                       <!-- Seam -->
                       <listener>
                       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                       </listener>
                      
                       <context-param>
                       <param-name>org.jboss.seam.core.init.myFacesLifecycleBug</param-name>
                       <param-value>false</param-value>
                       </context-param>
                      
                       <filter>
                       <filter-name>Seam Redirect Filter</filter-name>
                       <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
                       </filter>
                      
                       <filter-mapping>
                       <filter-name>Seam Redirect Filter</filter-name>
                       <url-pattern>*.jsf</url-pattern>
                       </filter-mapping>
                      
                       <filter>
                       <filter-name>Seam Exception Filter</filter-name>
                       <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
                       </filter>
                      
                       <filter-mapping>
                       <filter-name>Seam Exception Filter</filter-name>
                       <url-pattern>*.jsf</url-pattern>
                       </filter-mapping>
                      
                       <context-param>
                       <param-name>org.jboss.seam.core.init.jndiPattern</param-name>
                       <param-value>kam/#{ejbName}/local</param-value>
                       </context-param>
                      
                       <listener>
                       <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
                       </listener>
                      
                       <!-- security requirement -->
                       <security-constraint>
                       <web-resource-collection>
                       <web-resource-name>AMT</web-resource-name>
                       <url-pattern>/pages/*</url-pattern>
                       </web-resource-collection>
                      
                       <auth-constraint>
                       <role-name>login</role-name>
                       </auth-constraint>
                      
                       <user-data-constraint>
                       <transport-guarantee>CONFIDENTIAL</transport-guarantee>
                       </user-data-constraint>
                      
                       </security-constraint>
                      
                       <security-role>
                       <description>Authorized to see all webpages</description>
                       <role-name>login</role-name>
                       </security-role>
                      
                       <!-- Authentifizierung -->
                       <login-config>
                       <auth-method>FORM</auth-method>
                       <realm-name>kamEntityManager</realm-name>
                       <form-login-config>
                       <form-login-page>/pages/login/login.jsf</form-login-page>
                       <form-error-page>/pages/login/error.jsf</form-error-page>
                       </form-login-config>
                       </login-config>
                      
                      </web-app>
                      


                      And here the snippet from the faces-config.xml:
                      <?xml version="1.0"?>
                      <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
                      
                      <faces-config>
                       <application>
                       <locale-config>
                       <default-locale>de</default-locale>
                       <!--
                       <supported-locale>en</supported-locale>
                       -->
                       </locale-config>
                       <message-bundle>
                       de.fhg.iff.kam.resources.messages
                       </message-bundle>
                       </application>
                      
                       <!-- seam -->
                       <application>
                       <variable-resolver>org.jboss.seam.jsf.SeamVariableResolver</variable-resolver>
                       </application>
                      
                       <!-- managed-beans -->
                       <managed-bean>
                       <managed-bean-name>DemoDate</managed-bean-name>
                       <managed-bean-class>java.util.Date</managed-bean-class>
                       <managed-bean-scope>request</managed-bean-scope>
                       </managed-bean>
                      
                       <!-- nav: Login -->
                       <navigation-rule>
                      
                       ...cut off...
                      
                       </navigation-rule>
                      
                       <application>
                       <view-handler>org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl</view-handler>
                       </application>
                      
                       <!-- -->
                       <lifecycle>
                       <!--phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener-->
                       <!-- phase-listener>org.jboss.seam.jsf.SeamTransactionManagedPersistencePhaseListener</phase-listener-->
                       <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
                       </lifecycle>
                      </faces-config>
                      


                      • 8. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                        Jens Weintraut Apprentice

                        My web.xml didn't include Seam Redirect Filter and the Seam Exception Filter. It doesn't further include those security constraints and the MyFacesExtensionsFilter. Apart from this my web.xml is the same as you have.

                        For debug purposes, I think, in the faces-config.xml the SeamVariableResolver wasn't included. But apart from this it didn't diffre from yours.

                        I tried all the combinations but I'm still getting the error that there are multiple @DataModelSelection fields.

                        • 9. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                          Jens Weintraut Apprentice

                          C'mon guys. I can't believe I'm the only one having this problem. And I think there's a solution. Maybe the way how to use @DataModels with tomahawk's dataTable is out-of-date, maybe there's a bug or maybe I've made a mistake.

                          Can't anybody reproduce this error (beside gengar)? What are the differences between a Seam 1.0 beta2 application and a Seam 1.0.0 CR3 application? I removed all the @Interceptors annotations and included an ejb-jar.xml. In the application.xml I added an element to include jboss-seam.jar. The web.xml and faces-config.xml seem to be OK.

                          I can't use another dataTable since I need the sorting functionality.

                          Here is my web.xml:

                          <?xml version="1.0" encoding="UTF-8"?>
                          <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
                          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
                          http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
                          
                           <!-- ** Seam Configuration ** -->
                           <listener>
                           <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                           </listener>
                          
                           <!-- Global JNDI name pattern for JBoss EJB3 (change for other servers) -->
                           <context-param>
                           <param-name>org.jboss.seam.core.init.jndiPattern</param-name>
                           <param-value>ares/#{ejbName}/local</param-value>
                           </context-param>
                          
                           <context-param>
                           <param-name>org.jboss.seam.core.init.myFacesLifecycleBug</param-name>
                           <param-value>true</param-value>
                           </context-param>
                          
                           <context-param>
                           <param-name>org.jboss.seam.core.init.debug</param-name>
                           <param-value>true</param-value>
                           </context-param>
                          
                           <context-param>
                           <param-name>org.jboss.seam.core.manager.conversationTimeout</param-name>
                           <param-value>120000</param-value>
                           </context-param>
                          
                           <context-param>
                           <param-name>org.jboss.seam.core.init.clientSideConversations</param-name>
                           <param-value>true</param-value>
                           </context-param>
                          
                           <filter>
                           <filter-name>Seam Redirect Filter</filter-name>
                           <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
                           </filter>
                          
                           <filter-mapping>
                           <filter-name>Seam Redirect Filter</filter-name>
                           <url-pattern>*.jsf</url-pattern>
                           </filter-mapping>
                          
                           <filter>
                           <filter-name>Seam Exception Filter</filter-name>
                           <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
                           </filter>
                          
                           <filter-mapping>
                           <filter-name>Seam Exception Filter</filter-name>
                           <url-pattern>*.jsf</url-pattern>
                           </filter-mapping>
                          
                          
                           <!-- ** myFaces Configuration ** -->
                           <listener>
                           <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
                           </listener>
                           <context-param>
                           <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
                           <param-value>client</param-value>
                           </context-param>
                           <context-param>
                           <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
                           <param-value>true</param-value>
                           </context-param>
                           <context-param>
                           <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
                           <param-value>true</param-value>
                           </context-param>
                           <context-param>
                           <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
                           <param-value>false</param-value>
                           </context-param>
                           <context-param>
                           <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
                           <param-value>false</param-value>
                           </context-param>
                           <context-param>
                           <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                           <param-value>.xhtml</param-value>
                           </context-param>
                           <servlet>
                           <servlet-name>Faces Servlet</servlet-name>
                           <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                           <load-on-startup>1</load-on-startup>
                           </servlet>
                           <servlet-mapping>
                           <servlet-name>Faces Servlet</servlet-name>
                           <url-pattern>*.jsf</url-pattern>
                           </servlet-mapping>
                          
                           <!-- ** Facelets Configuration ** -->
                           <context-param>
                           <param-name>facelets.DEVELOPMENT</param-name>
                           <param-value>true</param-value>
                           </context-param>
                           <context-param>
                           <param-name>facelets.SKIP_COMMENTS</param-name>
                           <param-value>false</param-value>
                           </context-param>
                          </web-app>


                          and my faces-config.xml:
                          <?xml version="1.0" encoding="UTF-8"?>
                          <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD
                          JavaServer Faces Config 1.0//EN"
                          "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
                          <faces-config>
                          <!-- omitted the navigation rules -->
                          
                           <converter>
                           <converter-id>com.idsscheer.ares.Cost</converter-id>
                           <converter-class>com.idsscheer.ares.CostConverter</converter-class>
                           </converter>
                          
                           <application>
                           <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
                           <variable-resolver>org.jboss.seam.jsf.SeamVariableResolver</variable-resolver>
                           <message-bundle>com.idsscheer.ares.resources.ares_messages</message-bundle>
                           <locale-config>
                           <default-locale>en</default-locale>
                           <supported-locale>de</supported-locale>
                           </locale-config>
                           </application>
                          
                           <lifecycle>
                           <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
                           <!--phase-listener>org.jboss.seam.jsf.SeamTransactionManagedPersistencePhaseListener</phase-listener-->
                           <!--phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener-->
                           </lifecycle>
                          </faces-config>


                          • 10. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                            Jens Weintraut Apprentice

                            Yeehaw. I've got it. Although I've only one @DataModel, only one @DataModelSelction and only one @DataModelSelectionIndex I had to add the parameter value to the @DataModelSelection annotation:

                            @DataModelSelection
                             @Out(required=false, scope=ScopeType.SESSION)
                             private Testaction foundTestaction;


                            became to
                            @DataModelSelection(value="getFoundTestactions")
                             @Out(required=false, scope=ScopeType.SESSION)
                             private Testaction foundTestaction;


                            After that the application deployed or to be more precise: this component got loaded without errors.

                            But this causes another problem: I've a class hierarchy in which the superclass holds @DataModelSelection and @DataModelSelectionIndex and its three subclasses have a @DataModel and a @Factory. The superclass is a normal class, not an entity and not a component. The three subclasses are components with different names.
                            I think you see the problem: Since the @DataModel annotation is used in the subclasses on methods with different names, I can't add the value parameter to the @DataModelSelection in the superclass because there are three @DataModel names, one for each component.

                            With Seam 1.0 beta2 this hierarchy wasn't a problem. It worked very well. The class hierarhy was introduced since before I had three classes with almost the same behaviour. And this behaviour is now encapsulated by the superclass. This made my subclasses pretty small and developing more effectively. I don't want to return to three single classes.

                            I hope there is another workaround or I revealed a bug, which will be fixed.

                            • 11. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                              Hagen Schink Newbie

                              Ok, it works, good job. I ask myselfe since when it has to be

                              @DataModelSelection(value="getUserlist")


                              and not

                              @DataModelSelection("userlist")
                              ?

                              It seems that I missed some changes since Beta 2 ;-).

                              • 12. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                                Jens Weintraut Apprentice

                                 

                                "gengar" wrote:
                                I ask myselfe since when it has to be

                                @DataModelSelection(value="getUserlist")


                                and not

                                @DataModelSelection("userlist")
                                ?


                                That depends on where the @DataModel annotation is located. I annotated the getter methods so I used the name of the getters. If you annotate the field you've to use the name of the field.

                                • 13. Re: @DataModel with Tomahawk with JBoss AS 4.0.4 and Seam 1.
                                  Hagen Schink Newbie

                                  I made the experience that you have to write @DataModelSelection(value="getFieldname"), because without the get it doesn't work.

                                  Here a short snippet of working code:

                                   @DataModel
                                   private List <ServiceItem> importCapsList;
                                   @DataModelSelection(value="getImportCapsList")
                                   private ServiceItem selectedCaps;
                                   @DataModelSelectionIndex
                                   private int capsIndex;
                                  


                                  For the case that there are more @DataModel's I tried that, until know it works:

                                   @DataModel
                                   private List <Textmodule> admHeadList;
                                   @DataModelSelection(value="getAdmHeadList")
                                   private Textmodule selectedAdmHead;
                                   @DataModelSelectionIndex(value="getSelectedAdmHead")
                                   private int admHeadIndex;
                                  
                                   @DataModel
                                   private List <Textmodule> admFootList;
                                   @DataModelSelection(value="getAdmFootList")
                                   private Textmodule selectedAdmFoot;
                                   @DataModelSelectionIndex(value="getSelectedAdmFoot")
                                   private int admFootIndex;
                                  


                                  Have a nice weekend!

                                  1 2 3 Previous Next