6 Replies Latest reply on Apr 16, 2007 2:37 PM by Roberta Flashman

    more than one Seam Phase Listeners?

    mrines77 Newbie

      As far as I can tell, I heve only the one (I thought obligatory) Seam Phase Listener in my faces-config.xml file:

      <!-- Same for all Seam applications -->
       <application>
       <variable-resolver>org.jboss.seam.jsf.SeamVariableResolver</variable-resolver>
       </application>
       <lifecycle>
       <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
       </lifecycle>
      


      Here is the startup portion of the log4j file. Notice the duplicate statements generated starting at the "WARN There should only be one Seam phase listener per application:"

      10:25:27,093 [main] INFO - Reading standard config org/apache/myfaces/resource/standard-faces-config.xml
      10:25:27,484 [main] INFO - Reading config jar:file:/WEB-INF/lib/ajax4jsf.jar!/META-INF/faces-config.xml
      10:25:27,500 [main] INFO - Reading config jar:file:/WEB-INF/lib/jboss-seam-debug.jar!/META-INF/faces-config.xml
      10:25:27,515 [main] INFO - Reading config jar:file:/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/faces-config.xml
      10:25:27,531 [main] INFO - Reading config jar:file:/WEB-INF/lib/jboss-seam.jar!/META-INF/faces-config.xml
      10:25:27,546 [main] INFO - Reading config jar:file:/WEB-INF/lib/jsf-facelets.jar!/META-INF/faces-config.xml
      10:25:27,546 [main] INFO - Reading config jar:file:/WEB-INF/lib/tomahawk-1.1.3.jar!/META-INF/faces-config.xml
      10:25:27,578 [main] INFO - Reading config /WEB-INF/navigation.xml
      10:25:27,578 [main] INFO - Reading config /WEB-INF/faces-config.xml
      10:25:27,640 [main] INFO - Starting up MyFaces-package : myfaces-api in version : 1.1.5 from path : file:/WEB-INF/lib/myfaces-api-1.1.5.jar
      10:25:27,640 [main] INFO - Starting up MyFaces-package : myfaces-impl in version : 1.1.5 from path : file:/WEB-INF/lib/myfaces-impl-1.1.5.jar
      10:25:27,640 [main] INFO - MyFaces-package : tomahawk-sandbox not found.
      10:25:27,640 [main] INFO - Starting up MyFaces-package : tomahawk in version : 1.1.3 from path : file:/WEB-INF/lib/tomahawk-1.1.3.jar
      10:25:27,671 [main] WARN - Locale name in faces-config.xml null or empty, setting locale to default locale : en_US
      10:25:27,781 [main] WARN - There should only be one Seam phase listener per application
      10:25:27,781 [main] WARN - There should only be one Seam phase listener per application
      10:25:27,781 [main] INFO - Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
      10:25:27,796 [main] INFO - ServletContext '' initialized.
      10:25:27,796 [main] INFO - Welcome to Seam 1.2.0.PATCH1
      10:25:27,828 [main] INFO - scanning: /WEB-INF/lib/jboss-seam.jar
      10:25:27,828 [main] INFO - scanning: /WEB-INF/lib/jboss-seam.jar
      10:25:27,828 [main] DEBUG - archive: WEB-INF\lib\jboss-seam.jar
      10:25:27,828 [main] DEBUG - archive: WEB-INF\lib\jboss-seam.jar
      10:25:27,828 [main] DEBUG - found: META-INF/
      10:25:27,828 [main] DEBUG - found: META-INF/
      10:25:27,828 [main] DEBUG - found: META-INF/MANIFEST.MF
      10:25:27,828 [main] DEBUG - found: META-INF/MANIFEST.MF
      10:25:27,828 [main] DEBUG - found: META-INF/components.xml
      10:25:27,828 [main] DEBUG - found: META-INF/components.xml
      10:25:27,828 [main] DEBUG - found: META-INF/faces-config.xml
      10:25:27,828 [main] DEBUG - found: META-INF/faces-config.xml
      10:25:27,828 [main] DEBUG - found: org/
      10:25:27,828 [main] DEBUG - found: org/
      10:25:27,828 [main] DEBUG - found: org/jboss/
      10:25:27,828 [main] DEBUG - found: org/jboss/
      10:25:27,828 [main] DEBUG - found: org/jboss/seam/
      10:25:27,828 [main] DEBUG - found: org/jboss/seam/
      10:25:27,828 [main] DEBUG - found: org/jboss/seam/Component$1.class
      10:25:27,828 [main] DEBUG - found: org/jboss/seam/Component$1.class
      10:25:27,828 [main] DEBUG - found: org/jboss/seam/Component$BijectedAttribute.class
      10:25:27,828 [main] DEBUG - found: org/jboss/seam/Component$BijectedAttribute.class
      10:25:27,828 [main] DEBUG - found: org/jboss/seam/Component$BijectedField.class


      I notice that if I elimiate the Seam Phase Listener in my faces-config.xml, then my site comes up without the warning above but the ejb components do not appear in the application context within the debug page and I get a no Phase Id error instead. Can there be a built-in Seam Phase Listener that is conflicting with my webapp's one? Anyone else come across this scenario? One last note, even though I have only one log4.xml in my webapp, I start getting duplicate log messages right after the Seam Phase Listener warning. Any ideas? Sure would help a push here, a bit stuck.
      Mark

        • 1. Re: more than one Seam Phase Listeners?
          mrines77 Newbie

          Well, this message must not be answerable, at this time.

          Notice that Mike over at mhl496 is having similar problems getting Seam to be well behaved under Tomcat. Will be moving from Tomcat 5.5.20 to 6.0.10 shortly and perhaps some of these exceptions will disappear. Hopefully between us Tomcaters we can add to the knowledgebase of Seam.

          I would like to make sure that you know that I do appreciate the work that the Jboss Seam team is doing and realize that it is still in the early stages of development, especially as related to embedd ejb3 in Tomcat webapp. So keep up the good work Gavin, Pete, et al.
          Mark

          • 2. Re: more than one Seam Phase Listeners?
            Gavin King Master

            I don't understand this thread. Almost all the seam examples deploy on Tomcat with "ant deploy.tomcat". So copy the examples. If you cant make it work, that is because you are different to the example in some way.

            • 3. Re: more than one Seam Phase Listeners?
              Rob Jellinghaus Novice

              Are you using any other JARs in your project that reference Seam in any way? Or are there any JARs that contain any other custom listeners or faces-config.xml files?

              Can you deploy the existing examples to tomcat with "ant deploy.tomcat" and run them?

              Jason DeTiberus has actually just beaten me to a working test integration of GWT and Seam, and he had issues with error messages about duplicate Seam phase listeners, even though what he had was a GwtPhaseListener (from the g4jsf-cdk) and a SeamPhaseListener. So it's possible that multiple listeners can (in some permutations) confuse the Seam listener into double invocations. Or something. I should get to try his code this weekend and will try to produce a more detailed analysis then.

              Cheers,
              Rob

              • 4. Re: more than one Seam Phase Listeners?
                Jason DeTiberus Newbie

                It appears that your error is slightly different than the one I was encountering. I would only get the multiple SeamPhaseListener exception when trying to do an asynchronous call, there was no message on deployment.

                Are you sure that you are not including files multiple times in your deployment? But if that is not the problem, then I would double check that your included libraries are not including a Phase Listener that is causing problems with the SeamPhaseListener.

                Hope this helps,
                Jason

                • 5. Re: more than one Seam Phase Listeners?
                  mrines77 Newbie

                  RobJ wins the gold star, or maybe a silver one instead, as he came closest to the root problem that I was having:
                  First, the WARN message of duplicate SeamPhaseListener was being generated by AbstractSeamPhaseListener's constructor using a (I hate flags) boolean flag.
                  Apparently, having jsf-impl.jar and myfaces-impl.jar in the same webapp's WEB-INF/lib directory causes the faces-config and/or jsf related files to be loaded twice, once for jsf-impl.jar and once for myfaces-impl.jar. So I guess I have to choose which one I want to use and disgard the other. So many possible combinations and permutations in this environment:()!
                  Mark

                  • 6. Re: more than one Seam Phase Listeners?
                    Roberta Flashman Newbie

                    Did you ever find a solution/answer to your question about more than one PhaseListener appearing in the application?

                    I have received a similar message while trying to deploy a seam portlet in the LifeRay Portal.