2 Replies Latest reply on May 31, 2011 12:14 PM by liriarte

    Eclipse + JBoss tools - application.xml

    liriarte

      Hi,

       

      I'm using Eclipse Helios (Helios Service Release 2 Build id: 20110218-0911) and JBoss Tools (version 3.2.0). I use maven just to handle the dependencies but without m2eclipse.

       

      In my EAR project I have an application.xml file as follows:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" version="5">
        <description>Xstreamline ear project</description>
        <display-name>xstreamline3-ear</display-name>
        <module>
          <ejb>jboss-seam-2.2.1.Final.jar</ejb>
        </module>
        <module>
          <web>
            <web-uri>xstreamline3-3.1.1.war</web-uri>
            <context-root>/</context-root>
          </web>
        </module>
        <library-directory>/lib</library-directory> 
      </application>
      

       

      When I add the server and publish the application, I get:

       

      1) Two copies of jboss-seam-2.2.1.Final.jar, one is at the main level of the EAR, and the other is inside the WAR file (xstreamline3-3.1.1.war/jboss-seam-2.2.1.Final.jar)

      2) The auto-generated application.xml, under main/application/META-INF/, besides my own application.xml under the root EAR folder/META-INF

       

      When I run the server from Eclipse it starts OK, but when I enter the application I get the following error:

       

      ERROR [Exceptions] handled and logged exception
      java.lang.IllegalStateException: No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed)
      

       

      If I remove one of the jboss-seam-2.2.1.Final.jar under the WAR file it DOESN'T work. It ONLY WORKS if I only remove the other jboss-seam-2.2.1.Final.jar (which is in the root EAR folder) and I changed the ejb module declaration in my application xml as follows:

       

      <module>
          <ejb>xstreamline3-3.1.1.war/jboss-seam-2.2.1.Final.jar</ejb>
        </module>
      

       

      I don't understand why this is happening:

       

      Why the plugin is copying one jboss-seam-2.2.1.Final.jar under the WAR file?

       

      And why only works if I leave the file there and not in the EAR root?

       

      What should I do with the auto-generated application.xml ?

       

      Please help me with this. I have read too many differents posts about the auto-genereated application.xml but I couldn't find a clear explanation about how to handle it.

        • 1. Re: Eclipse + JBoss tools - application.xml
          maxandersen

          is xstreamline3-3.1.1.war also built from inside eclipse ?

           

          Does it actually contain that jar ?

           

          Where is the seam jar when you build from command line ?

           

          Could you reduce this to an app that we could try import/use to reproduce ?

          • 2. Re: Eclipse + JBoss tools - application.xml
            liriarte

            Yes, xstreamline3-3.1.1.war is built from inside eclipse,. But it doen't contain the seam jar.

             

            The seam jar is in the local maven repository like all the jars.

             

            It's difficult to reduce it because it has a lot of code and other stuff.

             

            What I would like to know is why the plugin is copying the seam.jar inside the war. There ir no setting or configuration in order to do that.

             

            How does it work? I mean, when the plugin publishes all the code, how does it handle the EJB module declared in the application.xml? Does it copy the file according to some rule or it looks at the application.xml?

             

            PS: And I realized tha the main/application/META-INF/application.xml is not necesary and is not generated by the plugin. I can keep using the one located at the default META-INF folder of the project