14 Replies Latest reply on Nov 7, 2009 9:10 PM by cleverson.sacramento

    Problem with Jboss 4.2.3

    joeviterbo

      A project in an EAR I deployed on JBoss AS 4.2.2 cuases the No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed) when the web-app starts.
      After I redeployed it on 4.2.2 it worked without any problems.
      Used both servers after a clean install.


      Same happenes when deploying to the server supplied with JBDS.


      Did anyone else experience this problem and has a solution?


      Using JBoss Seam 2.0.2SP1 and JBDS 1.1

        • 1. Re: Problem with Jboss 4.2.3
          ashishkulkarni.ashish.kulkarnisoftware.com

          Hi Christian,


          Are you using the JDK 5 edition of JBoss 4.2.3 or is it the JDK 6 edition?


          I am using JDK 5 edition with JDK 1.5.0 update 10 and it is working fine for me.


          Best Regards,


          Ashish.

          • 2. Re: Problem with Jboss 4.2.3
            andreas.eigenmann

            Hi all


            Same problem here. Project works fine with JBoss AS 4.2.2. Starting the same application with JBoss AS 4.2.3 causes exception No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed). I am using JDK 1.5.0 Update 16.

            • 3. Re: Problem with Jboss 4.2.3
              joeviterbo

              Sorry for replying lately, I was on vacation.


              I'm using JDK 1.5.0 Update 11.

              • 4. Re: Problem with Jboss 4.2.3
                icetbr

                Same problem here, doesn't matter which jdk (5, 6) BUT I only get this error with this one project. It's like if my project is named project1 I get this error. If I name it project2 it works. Crazy stuff. I have a project1 in another folder in my computer, perhaps there is some crazy linking going one here.


                It works fine on 4.2.2.

                • 5. Re: Problem with Jboss 4.2.3
                  pmuir

                  What exactly is the project name which fails?

                  • 6. Re: Problem with Jboss 4.2.3
                    Same project here. (using same configuration in Linux Ubuntu x64 and Vista Ultimate x64)

                    , I'm using JDK 1.6.0_7 with JBOss 4.2.3 GA(JDK 1.6)

                    I have create a new seam project using JBoss Tools 2.1.2 GA with Eclipse 3.3 deploy as an EAR.

                    Error: No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed)



                    I'm new to seam, not to Jee,and i trying to learn about seam, i think it is a great framework. I hope to solve this isuue to continue ...

                    Thanks in advance.
                    • 7. Re: Problem with Jboss 4.2.3
                      pogi

                      Hi
                      I had the same problem too.


                      This is my develpment environment:
                      JDBS 1.1.0 GA
                      JBoss AS 4.2.3
                      JDK 1.5.0.14


                      But now I fix it By this evironment:
                      JDBS 1.1.0 GA(reinstall)
                      JBoss AS 4.2.2(not use 4.2.3, can't work)
                      JDK 1.5.0.14


                      hope this can help you.

                      • 8. Re: Problem with Jboss 4.2.3
                        gallowaym
                        I'm having the same problem.

                        I'm using the JDK 5 version on Mac.  I tried with both the 1.5 and 1.6 JDK.

                        My app was created with Eclipse Seam Web App Wizard and then Create Seam Entitied from database.

                        It works fine on JBoss 4.2.2 but I get the same error described above on 4.2.3.

                        I checked my web.xml and definitely only have one Seam Listener defined.

                        I did a search in the project for "listener" and it only appears in the web.xml file.

                        Here's my current web.xml:

                        <?xml version="1.0" ?>
                        <web-app xmlns="http://java.sun.com/xml/ns/javaee"
                                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
                                 version="2.5">

                            <!-- Ajax4jsf -->
                           
                            <context-param>
                                <param-name>org.richfaces.SKIN</param-name>
                                <param-value>blueSky</param-value>
                            </context-param>

                           <!-- Seam -->
                           
                           <listener>
                              <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                           </listener>
                           
                            <filter>
                                <filter-name>Seam Filter</filter-name>
                                <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
                            </filter>

                            <filter-mapping>
                                <filter-name>Seam Filter</filter-name>
                                <url-pattern>/*</url-pattern>
                            </filter-mapping>
                               
                           <servlet>
                              <servlet-name>Seam Resource Servlet</servlet-name>
                              <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
                           </servlet>
                           
                           <servlet-mapping>
                              <servlet-name>Seam Resource Servlet</servlet-name>
                              <url-pattern>/seam/resource/*</url-pattern>
                           </servlet-mapping>
                          
                           <!-- Facelets development mode (disable in production) -->
                          
                           <context-param>
                              <param-name>facelets.DEVELOPMENT</param-name>
                              <param-value>true</param-value>
                           </context-param>
                           
                           <!-- JSF -->
                          
                           <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>*.seam</url-pattern>
                           </servlet-mapping>
                                         
                           <security-constraint>
                               <display-name>Restrict raw XHTML Documents</display-name>
                               <web-resource-collection>
                                   <web-resource-name>XHTML</web-resource-name>
                                   <url-pattern>*.xhtml</url-pattern>
                               </web-resource-collection>
                               <auth-constraint/>
                           </security-constraint>
                          
                        </web-app>

                        -Matt

                        • 9. Re: Problem with Jboss 4.2.3
                          gallowaym
                          I noticed on JBoss startup that there is a warning about having only one listener:

                          02:49:32,127 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
                          02:49:32,133 INFO  [EJB3Deployer] Deployed: file:/Users/gallowaym/Java2/jboss-4.2.3.GA/server/default/deploy/TR2-ear.ear/TR2-ejb.jar/
                          02:49:32,279 INFO  [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
                          02:49:32,281 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=TR2-ear.ear,jar=jboss-seam.jar,name=TimerServiceDispatcher,service=EJB3 with dependencies:
                          02:49:32,307 INFO  [EJBContainer] STARTED EJB: org.jboss.seam.async.TimerServiceDispatcher ejbName: TimerServiceDispatcher
                          02:49:32,335 INFO  [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateful.StatefulContainer
                          02:49:32,337 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=TR2-ear.ear,jar=jboss-seam.jar,name=EjbSynchronizations,service=EJB3 with dependencies:
                          02:49:32,346 INFO  [EJBContainer] STARTED EJB: org.jboss.seam.transaction.EjbSynchronizations ejbName: EjbSynchronizations
                          02:49:32,362 INFO  [EJB3Deployer] Deployed: file:/Users/gallowaym/Java2/jboss-4.2.3.GA/server/default/deploy/TR2-ear.ear/jboss-seam.jar
                          02:49:32,366 INFO  [TomcatDeployer] deploy, ctxPath=/TR2, warUrl=.../deploy/TR2-ear.ear/TR2.war/
                          02:49:33,706 WARN  [SeamPhaseListener] There should only be one Seam phase listener per application
                          02:49:34,663 INFO  [ServletContextListener] Welcome to Seam 2.0.1.GA
                          02:49:37,288 INFO  [Initialization] Namespace: http://jboss.com/products/seam/security, package: org.jboss.seam.security, prefix: org.jboss.seam.security
                          02:49:37,289 INFO  [Initialization] Namespace: http://jboss.com/products/seam/international, package: org.jboss.seam.international, prefix: org.jboss.seam.international
                          02:49:37,289 INFO  [Initialization] Namespace: http://jboss.com/products/seam/persistence, package: org.jboss.seam.persistence, prefix: org.jboss.seam.persistence


                          Out of curiosity, I removed the following form web.xml:

                             <listener>
                                <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                             </listener>

                          I figured that if there really was more than one than this might help. (I was pretty certain it wouldn't but it was worth a shot.)

                          I still got the "WARN  [SeamPhaseListener] There should only be one Seam phase listener per application" message but got a slew of error messages immediately following:


                          02:46:36,509 INFO  [EJBContainer] STARTED EJB: org.jboss.seam.async.TimerServiceDispatcher ejbName: TimerServiceDispatcher
                          02:46:36,536 INFO  [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateful.StatefulContainer
                          02:46:36,537 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=TR2-ear.ear,jar=jboss-seam.jar,name=EjbSynchronizations,service=EJB3 with dependencies:
                          02:46:36,547 INFO  [EJBContainer] STARTED EJB: org.jboss.seam.transaction.EjbSynchronizations ejbName: EjbSynchronizations
                          02:46:36,564 INFO  [EJB3Deployer] Deployed: file:/Users/gallowaym/Java2/jboss-4.2.3.GA/server/default/deploy/TR2-ear.ear/jboss-seam.jar
                          02:46:36,569 INFO  [TomcatDeployer] deploy, ctxPath=/TR2, warUrl=.../deploy/TR2-ear.ear/TR2.war/
                          02:46:37,871 WARN  [SeamPhaseListener] There should only be one Seam phase listener per application
                          02:46:38,806 ERROR [[/TR2]] Exception starting filter Seam Filter
                          java.lang.IllegalStateException: Attempted to invoke a Seam component outside the an initialized application
                          .
                          .
                          .

                          I hope this means something to someone.

                          -Matt

                          • 10. Re: Problem with Jboss 4.2.3
                            beren.beren.patmedia.net

                            I have the same issue using JBoss Tools. I have solved this by editing the MANIFEST.MF file in the ejb sub-project. Remove the reference to jboss-seam.jar. Then add this back to your build path manually. Now redeploy and you should be good to go.


                            On my machine I have this issue with both 1.5 and 1.6 JDKs, but I'll admit that I have a lot of various tools and its possible that somehow the project generation tools are still finding a 1.6 JDK, but I don't think so. I've tried everything I can think of, but I in the end this is a serious shortcoming of the jboss tools that they do not yet support 1.6. Not sure what they are waiting for with 1.5 going end of life next summer. They have support slated for Tools 3.0, but looking at the Jira for that project is not encouraging. 


                            beren

                            • 11. Re: Problem with Jboss 4.2.3
                              gallowaym

                              Beren,


                              You rock.  Removing jboss-seam.jar from MANIFEST.MF in EJB and then adding to classpath manually worked.


                              That said, this feels really sloppy and I have to echo your sentiments about JBoss Tools.  There's all kinds of bugs like this in Tools.  None of the jars that are in my main project get copied to the server directory when I deploy through tools, I have to move them manually but Tools will occasionally remove them for me (at which point I have to manually copy them again).  I've wrestled with 2 or 3 different classpath issues like this and the code generators generate some questionable code.


                              That said, for me (and I imagine lots of developer, particularly those new to J2EE, Seam, and/or programming in general ) without the Tools, I wouldn't even get out of the gate.  Especially given what the competition is offering, I would think there would be a lot more focus on the Tools project.  The reality is, no matter how powerful or scalable a framework/platform is, the success and popularity is largely driven by the initial learning curve.  The sad thing is that if Tools was less quirky and simply did the things it is suppose to do correctly and consistently it would already be enormously compelling. Instead, it's been enormously frustrating. 


                              Thanks again.


                              -Matt

                              • 12. Re: Problem with Jboss 4.2.3
                                max.max.andersen.jboss.com

                                You rock.  Removing jboss-seam.jar from MANIFEST.MF in EJB and then adding to classpath manually worked.


                                This unfortunate bug is caused by changes in how AS and Seam is packaged/deploying things.
                                The behavior in JBoss Tools were behaving well when it was initially released. We will be looking into fixing this properly.



                                That said, this feels really sloppy and I have to echo your sentiments about JBoss Tools.  There's all kinds of bugs like this in Tools.  None of the jars that are in my main project get copied to the server directory when I deploy through tools, I have to move them manually but Tools will occasionally remove them for me (at which point I have to manually copy them again).  I've wrestled with 2 or 3 different classpath issues like this and the code generators generate some questionable code.


                                We know that Eclipse WTP introduced a bug we had to patch around to make deployment of EJB3's to work. Did you follow the release notes on how to get that patch ?
                                Are you talking about another issue ? jira-link ?



                                That said, for me (and I imagine lots of developer, particularly those new to J2EE, Seam, and/or programming in general ) without the Tools, I wouldn't even get out of the gate.  Especially given what the competition is offering, I would think there would be a lot more focus on the Tools project.  The reality is, no matter how powerful or scalable a framework/platform is, the success and popularity is largely driven by the initial learning curve.  The sad thing is that if Tools was less quirky and simply did the things it is suppose to do correctly and consistently it would already be enormously compelling. Instead, it's been enormously frustrating. 


                                I might sound a bit repetitive here but making sure that JBoss Tools works with all released versions of Seam and AS is not a small task. We need all the help we can get from the community to lock down any quirks and issues that comes up when you guys uses it. There are so many combinations of configurations that we cannot cover them all no matter how many resources we throw at it.


                                You say did the things it is suppose to do correctly and consistently hinting that it apparently it doesn't..could you please open jiras for those things and explain a bit more what behavir is incorrect and incoherent.


                                Same with the code generation that should be wrong - please create jiras!


                                p.s. I dont follow this forum day-to-day - best way to reach us about tools are in the tools forum; thanks ;)

                                • 13. Re: Problem with Jboss 4.2.3
                                  vladtwilight

                                  The cause of this problem is multiple jboss-seam.jar files on the classpath of a project.  For instance I had a jboss-seam.jar in my project.war/WEB-INF/lib and also in my project.ear root folder.  Jboss-seam.jar should only exist in your project.ear root folder.  I deleted the file from /WEB-INF/lib and fixed the error described above.

                                  • 14. Re: Problem with Jboss 4.2.3
                                    cleverson.sacramento

                                    Probably the jboss-seam.jar is present in both: EAR root and
                                    EAR lib folder.


                                    If you are using <module><ejb>jboss-seam.jar</ejb></module> in your application.xml then remove the JAR yourapp.ear/lib/jboss-seam.jar. But if you aren't then remove yourapp.ear/jboss-seam.jar.