Simple test failing in Glassfish Remote Container: Module type not recognized for module
sfriesen Mar 4, 2013 1:56 PMHi,
I'm relatively new to Arquillian and am having trouble getting my current very simple test to work using a remote Glassfish container. I am running Glassfish 3.1.2.2. I see that Dan Allen is working on getting a managed container adapter for Glassfish working, but I am using the remote container adapter. So I assume I'm OK on that front. The test runs successfully using embedded Glassfish, just not remote Glassfish, which makes me think something is wrong with my pom, but I'm not seeing it.
When I try to install, Maven is saying this:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project SteveTest: There are test failures.
The error in the server.log is this:
[#|2013-03-04T10:03:29.626-0800|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=92;_ThreadName=Thread-2;|Module type not recognized for module C:\JavaEE\glassfish-3.1.2.2\glassfish\domains\domain1\applications\test|#]
[#|2013-03-04T10:03:29.627-0800|SEVERE|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=92;_ThreadName=Thread-2;|There is no installed container capable of handling this application test|#]
The surefire-report says this:
-------------------------------------------------------------------------------
Test set: com.steve.stevetest.test.SimpleClass1Test
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.832 sec <<< FAILURE!
com.steve.stevetest.test.SimpleClass1Test Time elapsed: 4.828 sec <<< ERROR!
com.sun.jersey.api.container.ContainerException: exit_code: FAILURE, message: Error occurred during deployment: There is no installed container capable of handling this application test. Please see server.log for more details. [status: CLIENT_ERROR reason: Bad Request]
The project is a simple EJB module called SteveTest (created in NetBeans) with 2 classes--SimpleClass1 and a test class--SimpleClass1Test.
SimpleClass1 is simple:
package com.steve.stevetest.ejb; public class SimpleClass1 { public String getSomething() { return "getSomething result"; } }
SimpleClass1Test is also fairly small for a test class:
package com.steve.stevetest.test; import com.steve.stevetest.ejb.SimpleClass1; import javax.inject.Inject; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(Arquillian.class) public class SimpleClass1Test { public SimpleClass1Test() { } @Deployment public static JavaArchive createDeployment() { JavaArchive javaArchive = ShrinkWrap.create(JavaArchive.class) .addClass(SimpleClass1.class) .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); System.out.println(javaArchive.toString(true)); return javaArchive; } @Inject SimpleClass1 simpleClass1; @Test public void should_create_greeting() { Assert.assertEquals("getSomething result", simpleClass1.getSomething()); } }
The pom.xml file is:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.steve</groupId> <artifactId>SteveTest</artifactId> <version>1.0-SNAPSHOT</version> <packaging>ejb</packaging> <name>SteveTest</name> <properties> <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>1.0.3.Final</version> <scope>import</scope> <type>pom</type> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.12</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ejb-plugin</artifactId> <configuration> <ejbVersion>3.0</ejbVersion> </configuration> </plugin> </plugins> <testResources> <testResource> <directory>src/test/resources</directory> </testResource> <testResource> <directory>src/test/resources-glassfish-remote</directory> </testResource> </testResources> </build> <dependencies> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-6.0</artifactId> <version>1.0.0.Final</version> <type>pom</type> <scope>provided</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.container</groupId> <artifactId>arquillian-glassfish-remote-3.1</artifactId> <version>1.0.0.CR3</version> <scope>test</scope> </dependency> </dependencies> </project>
I appreciate any help.
-Steve