5 Replies Latest reply on Apr 7, 2010 3:06 AM by Stuart Douglas

    Extending Seam core class and overriding methods

    Arbi Sookazian Master
      @Scope(ScopeType.EVENT)
      @Name("org.jboss.seam.core.manager")
      @Install(precedence=BUILT_IN)
      @BypassInterceptors
      public class Manager



      org.jboss.seam.annotations.Install
      public static final int      APPLICATION      20
      public static final int      BUILT_IN      0
      public static final int      DEPLOYMENT      30
      public static final int      FRAMEWORK      10
      public static final int      MOCK              40



      I'd like to @Override some methods in this Seam component for learning/experimentation purposes and substitute with my own.  What is the best approach to do this?


      I'm guessing write a public class that extends Manager and use @Install(precedence=MOCK) or anything higher than BUILT_IN (0).

        • 1. Re: Extending Seam core class and overriding methods
          Arbi Sookazian Master
          @Name("org.jboss.seam.core.manager")
          @Install(precedence=MOCK)
          public class NewManager extends org.jboss.seam.core.Manager {
               
               private static final LogProvider log = Logging.getLogProvider(NewManager.class);
          
               @Override
               public void handleConversationPropagation(Map parameters)
                  {      
                     ConversationPropagation propagation = ConversationPropagation.instance();
                     
                     if (propagation.getPropagationType() == null)
                     {
                        return;
                     }
          
                     switch (propagation.getPropagationType())
                     {
                        case BEGIN:
                           /*if ( super.isLongRunningConversation() )
                           {
                              throw new IllegalStateException("long-running conversation already active");
                           }*/
                           beginConversation();
                           
                           if (propagation.getPageflow() != null)
                           {
                              Pageflow.instance().begin( propagation.getPageflow() );
                           }
                           break;
                        case JOIN:
                           if ( !super.isLongRunningConversation() )
                           {
                              beginConversation();
                              
                              if (propagation.getPageflow() != null)
                              {
                                 Pageflow.instance().begin( propagation.getPageflow() );
                              }
                           }
                           break;
                        case NEST:
                           if ( isLongRunningOrNestedConversation() ) 
                           {
                               beginNestedConversation();
                           }
                           else 
                           {
                               beginConversation();
                           }
                           
                           if (propagation.getPageflow() != null)
                           {
                              Pageflow.instance().begin( propagation.getPageflow() );
                           }
                           break;
                        case END:
                           endConversation(false);
                           break;
                     }
                  }
               
                public void beginConversation()
                  {
                     //if ( !isLongRunningConversation() )
                     //{
                        log.debug("Beginning long-running conversation");
                        setLongRunningConversation(true);
                        createConversationEntry();
                        Conversation.instance(); //force instantiation of the Conversation in the outer (non-nested) conversation
                        storeConversationToViewRootIfNecessary();
                        if ( Events.exists() ) Events.instance().raiseEvent(EVENT_CONVERSATION_BEGIN);
                     //}
                  }
                
                private ConversationEntry createConversationEntry()
                  {
                     ConversationEntry entry = ConversationEntries.instance().createConversationEntry( getCurrentConversationId(), getCurrentConversationIdStack() );
                     if ( !entry.isNested() ) 
                     {
                        //if it is a newly created nested 
                        //conversation, we already own the
                        //lock
                        entry.lock();
                     }
                     return entry;
                  }
               
          }
          



          07:30:53,845 ERROR [SeamPhaseListener] swallowing exception
          java.lang.ClassCastException: org.jboss.seam.example.booking.NewManager_$$_javassist_seam_2
               at org.jboss.seam.faces.FacesManager.instance(FacesManager.java:313)
               at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:487)
               at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:148)
               at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:118)
               at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
               at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96)
               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:40)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
               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.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
               at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
               at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
               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:60)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
               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:173)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
               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:241)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
               at java.lang.Thread.run(Thread.java:595)
          07:30:56,060 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/s.taglib.xml
          07:30:56,105 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
          07:30:56,116 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
          07:30:56,145 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
          07:30:56,174 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
          07:30:56,186 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
          07:30:56,263 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/a4j.taglib.xml
          07:30:56,287 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/ajax4jsf.taglib.xml
          07:30:56,297 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/jsp.taglib.xml
          07:30:56,450 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/rich.taglib.xml
          07:30:56,470 INFO  [compiler] Added Library from: jar:file:/C:/java/jbdevstudio/jboss-eap/jboss-as/server/default/deploy/jboss-seam-booking.ear/jboss-seam-booking.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/richfaces.taglib.xml
          07:30:57,478 WARN  [SeamPhaseListener] uncaught exception, passing to exception handler
          java.lang.ClassCastException: org.jboss.seam.example.booking.NewManager_$$_javassist_seam_2
               at org.jboss.seam.faces.FacesManager.instance(FacesManager.java:313)
               at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:504)
               at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:249)
               at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
               at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
               at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
               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:40)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
               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.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
               at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
               at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
               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:60)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
               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:173)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
               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:241)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
               at java.lang.Thread.run(Thread.java:595)
          07:30:57,480 ERROR [SeamPhaseListener] swallowing exception
          java.lang.ClassCastException: org.jboss.seam.example.booking.NewManager_$$_javassist_seam_2
               at org.jboss.seam.faces.FacesManager.instance(FacesManager.java:313)
               at org.jboss.seam.jsf.SeamPhaseListener.afterRenderResponse(SeamPhaseListener.java:504)
               at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:249)
               at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
               at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:175)
               at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:114)
               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:40)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
               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.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
               at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
               at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
               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:60)
               at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
               at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
               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:173)
               at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
               at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
               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:241)
               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
               at java.lang.Thread.run(Thread.java:595)
          07:35:57,953 WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.BasicAction_58] - Abort of action id -3f57ff39:c84d:4a59f1e6:bd invoked while multiple threads active within it.
          07:35:57,953 WARN  [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.CheckedAction_2] - CheckedAction::check - atomic action -3f57ff39:c84d:4a59f1e6:bd aborting with 1 threads active!
          

          • 2. Re: Extending Seam core class and overriding methods
            Arbi Sookazian Master

            I forgot an @Override for public void beginConversation(), so I added that and reproduced exceptions.


            Note:


            2009-07-12 08:00:11,841 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.manager
            2009-07-12 08:00:11,841 INFO  [org.jboss.seam.init.Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.manager



            It would be nice if Seam logged the names (package and class) at DEBUG level.


            Why is it logging that line twice?


            I only see one reference to an installed component named org.jboss.seam.core.manager after those logging statements:


            08:00:12,210 INFO  [Component] Component: org.jboss.seam.core.manager, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.example.booking.NewManager



            So why is this line being hit?


            public static FacesManager instance()
               {
                  return (FacesManager) Manager.instance();
               }



            as evidenced by my debugger brkpt and this output:


            08:08:05,159 ERROR [SeamPhaseListener] swallowing exception
            java.lang.ClassCastException: org.jboss.seam.example.booking.NewManager_$$_javassist_seam_2
                 at org.jboss.seam.faces.FacesManager.instance(FacesManager.java:313)



            From a UI perspective, the home page renders fine (booking app - 2.1.2.GA).


            When I login, I see this again:


            08:09:25,960 ERROR [ContainerBase] Servlet.service() for servlet Faces Servlet threw exception
            java.lang.ClassCastException: org.jboss.seam.example.booking.NewManager_$$_javassist_seam_2
                 at org.jboss.seam.faces.FacesManager.instance(FacesManager.java:313)



            So what is the fix here?


            all components that are installed at deployment time:


            08:12:19,821 INFO  [ServletContextListener] Welcome to Seam 2.1.2
            08:12:22,473 INFO  [Initialization] reading /WEB-INF/components.xml
            08:12:22,516 INFO  [Initialization] reading properties from: /seam.properties
            08:12:22,517 INFO  [Initialization] reading properties from: /jndi.properties
            08:12:22,578 INFO  [Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
            08:12:22,634 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.manager
            08:12:22,634 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.locale
            08:12:22,634 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.web.parameters
            08:12:22,635 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.web.isUserInRole
            08:12:22,635 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.resourceLoader
            08:12:22,635 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.web.userPrincipal
            08:12:22,635 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.persistence.persistenceProvider
            08:12:22,635 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.locale
            08:12:22,635 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.expressions
            08:12:22,635 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.transaction.synchronizations
            08:12:22,635 INFO  [Initialization] two components with same name, higher precedence wins: org.jboss.seam.core.manager
            08:12:22,705 INFO  [Component] Component: authenticator, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: org.jboss.seam.example.booking.AuthenticatorAction, JNDI: jboss-seam-booking/AuthenticatorAction/local
            08:12:22,770 INFO  [Component] Component: booking, scope: CONVERSATION, type: ENTITY_BEAN, class: org.jboss.seam.example.booking.Booking
            08:12:22,772 INFO  [Component] Component: bookingList, scope: SESSION, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.example.booking.BookingListAction, JNDI: jboss-seam-booking/BookingListAction/local
            08:12:22,792 INFO  [Component] Component: changePassword, scope: EVENT, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.example.booking.ChangePasswordAction, JNDI: jboss-seam-booking/ChangePasswordAction/local
            08:12:22,809 INFO  [Component] Component: hotel, scope: CONVERSATION, type: ENTITY_BEAN, class: org.jboss.seam.example.booking.Hotel
            08:12:22,810 INFO  [Component] Component: hotelBooking, scope: CONVERSATION, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.example.booking.HotelBookingAction, JNDI: jboss-seam-booking/HotelBookingAction/local
            08:12:22,833 INFO  [Component] Component: hotelSearch, scope: SESSION, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.example.booking.HotelSearchingAction, JNDI: jboss-seam-booking/HotelSearchingAction/local
            08:12:22,851 INFO  [Component] Component: org.jboss.seam.async.asynchronousExceptionHandler, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.async.AsynchronousExceptionHandler
            08:12:22,856 INFO  [Component] Component: org.jboss.seam.async.dispatcher, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.async.ThreadPoolDispatcher
            08:12:22,882 INFO  [Component] Component: org.jboss.seam.captcha.captcha, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.captcha.Captcha
            08:12:22,887 INFO  [Component] Component: org.jboss.seam.captcha.captchaImage, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.captcha.CaptchaImage
            08:12:22,889 INFO  [Component] Component: org.jboss.seam.core.ConversationIdGenerator, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationIdGenerator
            08:12:22,906 INFO  [Component] Component: org.jboss.seam.core.contexts, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Contexts
            08:12:22,908 INFO  [Component] Component: org.jboss.seam.core.conversation, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Conversation
            08:12:22,911 INFO  [Component] Component: org.jboss.seam.core.conversationEntries, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationEntries
            08:12:22,912 INFO  [Component] Component: org.jboss.seam.core.conversationListFactory, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationList
            08:12:22,915 INFO  [Component] Component: org.jboss.seam.core.conversationPropagation, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationPropagation
            08:12:22,916 INFO  [Component] Component: org.jboss.seam.core.conversationStackFactory, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationStack
            08:12:22,916 INFO  [Component] Component: org.jboss.seam.core.events, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.core.Events
            08:12:22,920 INFO  [Component] Component: org.jboss.seam.core.expressions, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.faces.FacesExpressions
            08:12:22,921 INFO  [Component] Component: org.jboss.seam.core.interpolator, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Interpolator
            08:12:22,923 INFO  [Component] Component: org.jboss.seam.core.locale, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.international.Locale
            08:12:22,955 INFO  [Component] Component: org.jboss.seam.core.manager, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.example.booking.NewManager
            08:12:22,991 INFO  [Component] Component: org.jboss.seam.core.resourceBundle, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.ResourceBundle
            08:12:22,993 INFO  [Component] Component: org.jboss.seam.core.resourceLoader, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.faces.ResourceLoader
            08:12:22,996 INFO  [Component] Component: org.jboss.seam.core.validators, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Validators
            08:12:23,004 INFO  [Component] Component: org.jboss.seam.debug.contexts, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.debug.Contexts
            08:12:23,022 INFO  [Component] Component: org.jboss.seam.debug.introspector, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.debug.Introspector
            08:12:23,050 INFO  [Component] Component: org.jboss.seam.debug.jsf.debugRedirect, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.debug.jsf.DebugRedirect
            08:12:23,051 INFO  [Component] Component: org.jboss.seam.document.documentStore, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.document.DocumentStore
            08:12:23,068 INFO  [Component] Component: org.jboss.seam.el.referenceCache, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.el.JBossELReferenceCache
            08:12:23,098 INFO  [Component] Component: org.jboss.seam.exception.exceptions, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.exception.Exceptions
            08:12:23,105 INFO  [Component] Component: org.jboss.seam.faces.dataModels, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.faces.DataModels
            08:12:23,107 INFO  [Component] Component: org.jboss.seam.faces.dateConverter, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.faces.DateConverter
            08:12:23,109 INFO  [Component] Component: org.jboss.seam.faces.facesContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.faces.FacesContext
            08:12:23,110 INFO  [Component] Component: org.jboss.seam.faces.facesPage, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.faces.FacesPage
            08:12:23,111 INFO  [Component] Component: org.jboss.seam.faces.httpError, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.faces.HttpError
            08:12:23,113 INFO  [Component] Component: org.jboss.seam.faces.redirect, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.faces.Redirect
            08:12:23,116 INFO  [Component] Component: org.jboss.seam.faces.renderer, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.ui.facelet.FaceletsRenderer
            08:12:23,117 INFO  [Component] Component: org.jboss.seam.faces.switcher, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.faces.Switcher
            08:12:23,119 INFO  [Component] Component: org.jboss.seam.faces.uiComponent, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.faces.UiComponent
            08:12:23,119 INFO  [Component] Component: org.jboss.seam.faces.validation, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.faces.Validation
            08:12:23,120 INFO  [Component] Component: org.jboss.seam.framework.currentDate, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.framework.CurrentDate
            08:12:23,135 INFO  [Component] Component: org.jboss.seam.framework.currentDatetime, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.framework.CurrentDatetime
            08:12:23,153 INFO  [Component] Component: org.jboss.seam.framework.currentTime, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.framework.CurrentTime
            08:12:23,174 INFO  [Component] Component: org.jboss.seam.graphicImage.image, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.ui.graphicImage.Image
            08:12:23,176 INFO  [Component] Component: org.jboss.seam.international.localeSelector, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.international.LocaleSelector
            08:12:23,178 INFO  [Component] Component: org.jboss.seam.international.messagesFactory, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.international.Messages
            08:12:23,183 INFO  [Component] Component: org.jboss.seam.international.statusMessages, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.faces.FacesMessages
            08:12:23,186 INFO  [Component] Component: org.jboss.seam.international.timeZone, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.international.TimeZone
            08:12:23,187 INFO  [Component] Component: org.jboss.seam.international.timeZoneSelector, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.international.TimeZoneSelector
            08:12:23,190 INFO  [Component] Component: org.jboss.seam.international.timeZones, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.international.TimeZones
            08:12:23,217 INFO  [Component] Component: org.jboss.seam.mail.mailSession, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.mail.MailSession
            08:12:23,229 INFO  [Component] Component: org.jboss.seam.navigation.pages, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.navigation.Pages
            08:12:23,240 INFO  [Component] Component: org.jboss.seam.navigation.safeActions, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.navigation.SafeActions
            08:12:23,241 INFO  [Component] Component: org.jboss.seam.persistence.persistenceContexts, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.persistence.PersistenceContexts
            08:12:23,249 INFO  [Component] Component: org.jboss.seam.persistence.persistenceProvider, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.persistence.HibernatePersistenceProvider
            08:12:23,252 INFO  [Component] Component: org.jboss.seam.security.configurationFactory, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.security.Configuration
            08:12:23,255 INFO  [Component] Component: org.jboss.seam.security.credentials, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.security.Credentials
            08:12:23,257 INFO  [Component] Component: org.jboss.seam.security.entityPermissionChecker, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.security.EntityPermissionChecker
            08:12:23,260 INFO  [Component] Component: org.jboss.seam.security.facesSecurityEvents, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.security.FacesSecurityEvents
            08:12:23,261 INFO  [Component] Component: org.jboss.seam.security.identifierPolicy, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.security.permission.IdentifierPolicy
            08:12:23,267 INFO  [Component] Component: org.jboss.seam.security.identity, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.security.Identity
            08:12:23,273 INFO  [Component] Component: org.jboss.seam.security.identityManager, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.security.management.IdentityManager
            08:12:23,276 INFO  [Component] Component: org.jboss.seam.security.management.roleAction, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.security.management.action.RoleAction
            08:12:23,305 INFO  [Component] Component: org.jboss.seam.security.management.roleSearch, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.security.management.action.RoleSearch
            08:12:23,320 INFO  [Component] Component: org.jboss.seam.security.management.userAction, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.security.management.action.UserAction
            08:12:23,337 INFO  [Component] Component: org.jboss.seam.security.management.userSearch, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.security.management.action.UserSearch
            08:12:23,368 INFO  [Component] Component: org.jboss.seam.security.passwordHash, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.security.management.PasswordHash
            08:12:23,371 INFO  [Component] Component: org.jboss.seam.security.permission.permissionSearch, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.security.permission.action.PermissionSearch
            08:12:23,387 INFO  [Component] Component: org.jboss.seam.security.permissionManager, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.security.permission.PermissionManager
            08:12:23,406 INFO  [Component] Component: org.jboss.seam.security.permissionMapper, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.security.permission.PermissionMapper
            08:12:23,407 INFO  [Component] Component: org.jboss.seam.security.persistentPermissionResolver, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.security.permission.PersistentPermissionResolver
            08:12:23,410 INFO  [Component] Component: org.jboss.seam.security.rememberMe, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.security.RememberMe
            08:12:23,414 INFO  [Component] Component: org.jboss.seam.theme.themeFactory, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.theme.Theme
            08:12:23,417 INFO  [Component] Component: org.jboss.seam.theme.themeSelector, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.theme.ThemeSelector
            08:12:23,418 INFO  [Component] Component: org.jboss.seam.transaction.ejbTransaction, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.transaction.EjbTransaction
            08:12:23,420 INFO  [Component] Component: org.jboss.seam.transaction.facesTransactionEvents, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.transaction.FacesTransactionEvents
            08:12:23,421 INFO  [Component] Component: org.jboss.seam.transaction.synchronizations, scope: EVENT, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.transaction.EjbSynchronizations, JNDI: jboss-seam-booking/EjbSynchronizations/local
            08:12:23,422 INFO  [Component] Component: org.jboss.seam.transaction.transaction, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.transaction.Transaction
            08:12:23,428 INFO  [Component] Component: org.jboss.seam.ui.EntityConverter, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.ui.EntityConverter
            08:12:23,431 INFO  [Component] Component: org.jboss.seam.ui.clientUidSelector, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.ui.ClientUidSelector
            08:12:23,450 INFO  [Component] Component: org.jboss.seam.ui.entityIdentifierStore, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.ui.EntityIdentifierStore
            08:12:23,467 INFO  [Component] Component: org.jboss.seam.ui.entityLoader, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.ui.JpaEntityLoader
            08:12:23,489 INFO  [Component] Component: org.jboss.seam.ui.facelet.faceletCompiler, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.ui.facelet.FaceletCompiler
            08:12:23,493 INFO  [Component] Component: org.jboss.seam.ui.facelet.facesContextFactory, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.ui.facelet.RendererFacesContextFactory
            08:12:23,501 INFO  [Component] Component: org.jboss.seam.ui.facelet.mockHttpSession, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.ui.facelet.HttpSessionManager
            08:12:23,504 INFO  [Component] Component: org.jboss.seam.ui.facelet.mockServletContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.ui.facelet.ServletContextManager
            08:12:23,506 INFO  [Component] Component: org.jboss.seam.ui.graphicImage.graphicImageResource, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.ui.graphicImage.GraphicImageResource
            08:12:23,508 INFO  [Component] Component: org.jboss.seam.ui.graphicImage.graphicImageStore, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.ui.graphicImage.GraphicImageStore
            08:12:23,512 INFO  [Component] Component: org.jboss.seam.ui.resource.webResource, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.ui.resource.WebResource
            08:12:23,515 INFO  [Component] Component: org.jboss.seam.web.ajax4jsfFilter, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.web.Ajax4jsfFilter
            08:12:23,518 INFO  [Component] Component: org.jboss.seam.web.ajax4jsfFilterInstantiator, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.ui.filter.Ajax4jsfFilterInstantiator
            08:12:23,523 INFO  [Component] Component: org.jboss.seam.web.exceptionFilter, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.web.ExceptionFilter
            08:12:23,525 INFO  [Component] Component: org.jboss.seam.web.hotDeployFilter, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.web.HotDeployFilter
            08:12:23,526 INFO  [Component] Component: org.jboss.seam.web.identityFilter, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.web.IdentityFilter
            08:12:23,527 INFO  [Component] Component: org.jboss.seam.web.isUserInRole, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.faces.IsUserInRole
            08:12:23,527 INFO  [Component] Component: org.jboss.seam.web.loggingFilter, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.web.LoggingFilter
            08:12:23,530 INFO  [Component] Component: org.jboss.seam.web.multipartFilter, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.web.MultipartFilter
            08:12:23,531 INFO  [Component] Component: org.jboss.seam.web.parameters, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.faces.Parameters
            08:12:23,532 INFO  [Component] Component: org.jboss.seam.web.redirectFilter, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.web.RedirectFilter
            08:12:23,533 INFO  [Component] Component: org.jboss.seam.web.servletContexts, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.web.ServletContexts
            08:12:23,534 INFO  [Component] Component: org.jboss.seam.web.session, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.web.Session
            08:12:23,535 INFO  [Component] Component: org.jboss.seam.web.userPrincipal, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.faces.UserPrincipal
            08:12:23,536 INFO  [Component] Component: register, scope: EVENT, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.example.booking.RegisterAction, JNDI: jboss-seam-booking/RegisterAction/local
            08:12:23,554 INFO  [Component] Component: user, scope: SESSION, type: ENTITY_BEAN, class: org.jboss.seam.example.booking.User

            • 3. Re: Extending Seam core class and overriding methods
              Arbi Sookazian Master

              It helps to carefully analyze the call stack in the stack trace:


              protected void afterRenderResponse(FacesContext facesContext)
                 {
                    //do this both before and after render, since conversations 
                    //and pageflows can begin during render
                    FacesManager.instance().prepareBackswitch(facesContext);
                    
                    PersistenceContexts persistenceContexts = PersistenceContexts.instance();
                    if (persistenceContexts != null) 
                    {
                        persistenceContexts.afterRender();
                    }
                    
                    ExternalContext externalContext = facesContext.getExternalContext();
                    Manager.instance().endRequest( externalContext.getSessionMap() );
                    FacesLifecycle.endRequest(externalContext);
                 }



              So there is the reference to FacesManager which did not require an injection.


              Ok, so now I'm not sure if I can extend the original Manager class with my NewManager class....


              Any recommendations other than altering the src code for org.jboss.seam.core.Manager?


              I renamed my class from NewManager to Manager and reproduced the exception...

              • 4. Re: Extending Seam core class and overriding methods
                Florian Petersen Newbie

                Hi Arbi,


                do you remember if/how you resolved this?
                I want to install an extended FacesMessages component with capabilities like e.g. message filtering by (resource bundle) key.
                I had a look at the StatusMessages source and i expect it to bring up the same problems you experienced (static methods instance(), runTasks() that will probably be bound somewhere)...


                Thanks a lot, best regards
                Flo

                • 5. Re: Extending Seam core class and overriding methods
                  Stuart Douglas Master

                  StatusMessages should work fine, it was designed for extension.


                  Arbi's problem was that he was inheriting from org.jboss.seam.core.Manager instead of org.jboss.seam.faces.FacesManager.