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.