This content has been marked as final.
Show 1 reply
-
1. Re: Maven2 example application for Seam2
cory_prowse Jan 3, 2008 1:34 AM (in response to cory_prowse)(Again I've crossposted from http://www.jboss.com/index.html?module=bb&op=viewtopic&t=126786
This appears more relevant to the embedded JBoss project than to Seam, as it relates to the classpath specified in the poms provided by Embedded JBoss.
---"pete.muir@jboss.org" wrote:
there is nothing wrong with Seam or Embedded here, just the way Maven sets up the classpath when running tests.
Aha!
The problem then appears to be with the thirdparty-all-beta*.jar file as it contains a separate copy of javassist.
Adding an exclusion for javassist to jboss-seam and hibernate-entitymanager in the Ejb's POM as follows:<dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam</artifactId> <exclusions> <exclusion> <groupId>jboss</groupId> <artifactId>javassist</artifactId> </exclusion> </exclusions> </dependency> ... <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <exclusions> <exclusion> <groupId>jboss</groupId> <artifactId>javassist</artifactId> </exclusion> </exclusions> </dependency>
causes the tests to now fail with:ERROR [AbstractKernelController] Error installing to Start: name=java:comp state=Create javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247) at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284) at javax.naming.InitialContext.lookup(InitialContext.java:351) at org.jboss.naming.JavaCompInitializer.start(JavaCompInitializer.java:83)
So it appears the dependencies need to be properly and fully speced out in the appropriate poms.
The use of these "*-all-*.jar" files appear the be the culprit.
Namely:hibernate-all-*.jar
jboss-embedded-all-*.jar
thirdparty-all-*.jar
These are not very useful in their current form for Maven.
Unless someone knows of a way to exclude certain dependencies in the test scope within maven? (I can't see a way)