Wrong Maven pom file for JBoss embedded ?
chawax Jan 28, 2008 5:05 AMHi,
I try to set up a JBoss embedded in a Maven 2 project, in order to use it for TestNG tests. I encountered classpath problems while starting the embedded server, and I am surprised nobody encoutered this since it is a problem with pom files on JBoss Maven repository !
To set up the embedded container, as suggested by this post by cory_prowse : http://www.jboss.com/index.html?module=bb&op=viewtopic&t=126786
I put these dependencies at first place in my pom.xml file :
<dependency> <groupId>org.jboss.embedded</groupId> <artifactId>thirdparty-all</artifactId> <version>beta3</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.embedded</groupId> <artifactId>hibernate-all</artifactId> <version>beta3</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.embedded</groupId> <artifactId>jboss-embedded-all</artifactId> <version>beta3</version> <scope>provided</scope> </dependency>
First problem
When I run mvn, it fails to resolve artifact org.jboss.embedded:jboss-embedded:jar:beta3-SNAPSHOT
The problem is that jboss-embedded-all-beta3.pom file contains a dependency to a jar that is not on the repository. The beta3 is on repository, but not beta3-SNAPSHOT !
Second problem
To solve the first problem, I changed this pom file to have a dependency to beta3. But now I have this error :
Caused by: java.lang.NoSuchMethodError: org.jboss.deployers.spi.structure.ContextInfo.getMetaDataPath()Ljava/util/List; at org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder.applyContextInfo(VFSStructureBuilder.java:93) at org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder.populateContext(AbstractStructureBuilder.java:73) ... 73 more
The problem is that jboss-embedded-beta3.pom has this dependency :
<groupId>org.jboss.microcontainer</groupId> <artifactId>jboss-deployers-client-spi</artifactId> <version>2.0.0.Beta6</version>
This causes a conflict with classes embedded in jboss-embedded-all ! So you have to exclude this dependency to make it work.
Finally my pom.xml file looks like this :
<dependency> <groupId>org.jboss.embedded</groupId> <artifactId>thirdparty-all</artifactId> <version>beta3</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.embedded</groupId> <artifactId>hibernate-all</artifactId> <version>beta3</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.embedded</groupId> <artifactId>jboss-embedded-all</artifactId> <version>beta3</version> <scope>provided</scope> <exclusions> <exclusion> <groupId>org.jboss.embedded</groupId> <artifactId>jboss-embedded</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.jboss.embedded</groupId> <artifactId>jboss-embedded</artifactId> <version>beta3</version> <scope>provided</scope> <exclusions> <exclusion> <groupId>org.jboss.microcontainer</groupId> <artifactId>jboss-deployers-client-spi</artifactId> </exclusion> </exclusions> </dependency>
I still can't make my tests work (JNDI problem), but now it looks like the server starts OK.
Is there a reason why I need to do this ? Or is it really a problem with files on JBoss Maven repository ?