-
1. Re: Arquillian confused
aslak Mar 13, 2013 8:26 AM (in response to gmatej)Matej Grasic wrote:
What I don't understand yet, is the pom, classpath, arquillian realtionship.
@Deployment
public static JavaArchive createTestArchive() {
return ShrinkWrap.create(JavaArchive.class, "test.jar") // Create jar
.addPackages(true, "com.company")
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml") // b
.addAsResource("META-INF/test-persistence.xml", "META-INF/persistence.xml");
}
How come that this test runs OK, altough in our persistence test Hibernate is selected which is not deployed with GF or GF emebedded. It's seems that some files... libs are loaded from the classpath anyway. The hibernate version running in GF embedded is the one listed in pom file. Can anyone tell me how thiw works and why some people had problmes, where they had to specially add hibernate...
Because you're running with a Embedded Container. When running in Embedded mode there is no classloader separation between your applictions classpath and the container. Anything on the application classpth can be seen by the Container.
Matej Grasic wrote:
Also two releated questions.... Why did we have to add this
<classpathDependencyExcludes>
<classpathDependencyExclude>javax:javaee-api</classpathDependencyExclude>
<classpathDependencyExclude>javax:javaee-web-api</classpathDependencyExclude>
</classpathDependencyExcludes>
To the surefire plugin.
Because those artifacts are useless runtime. See https://community.jboss.org/wiki/WhatsTheCauseOfThisExceptionJavalangClassFormatErrorAbsentCode
Matej Grasic wrote:
And why if we added Glassfish provied modules (jersey). like
<dependency>
<groupId>com.sun.jersey.glassfish.v3.osgi</groupId>
<artifactId>jersey-gf-server</artifactId>
<version>1.11.1</version>
<scope>provided</scope>
</dependency>
Probably due to the same application classpth isolation. The version of GlassFish Embedded is probably not compatible with the jersey version you're putting on classpath.
-
2. Re: Arquillian confused
gmatej Mar 14, 2013 5:08 AM (in response to aslak)Thanks that helped allot!!!
BR
MAtej