3 Replies Latest reply on Mar 5, 2013 12:19 PM by sfriesen

    Simple test failing in Glassfish Remote Container: Module type not recognized for module

    sfriesen

      Hi,

       

      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

        • 1. Re: Simple test failing in Glassfish Remote Container: Module type not recognized for module
          sfriesen

          Here's another thing that confuses me. I can export the jar created by ShrinkWrap and deploy that jar and include in that jar a class that is a WebService which injects the SimpleClass1 class. I call the getSomething() method in the web service and it works fine.

           

          Also, I tried removing the @Inject from the test class and hard-coding an assertion which will always be true, but still get the error. It must be in the deployment of the ShrinkWrap jar.

           

           

          //@Inject
              //SimpleClass1 simpleClass1;
              
              @Test
              public void should_create_greeting() {
                  Assert.assertEquals("getSomething result","getSomething result");
                      //simpleClass1.getSomething());
                  
              }
          
          

           

          Here's the exception--hoping this is helpful:

           

          com.steve.stevetest.test.SimpleClass1Test  Time elapsed: 5.612 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]

          at org.jboss.arquillian.container.glassfish.clientutils.GlassFishClientUtil.getResponseMap(GlassFishClientUtil.java:192)

          at org.jboss.arquillian.container.glassfish.clientutils.GlassFishClientUtil.POSTMultiPartRequest(GlassFishClientUtil.java:131)

          at org.jboss.arquillian.container.glassfish.clientutils.GlassFishClientService.doDeploy(GlassFishClientService.java:203)

          at org.jboss.arquillian.container.glassfish.CommonGlassFishManager.deploy(CommonGlassFishManager.java:101)

          at org.jboss.arquillian.container.glassfish.remote_3_1.GlassFishRestDeployableContainer.deploy(GlassFishRestDeployableContainer.java:71)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)

          at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

          at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

          at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

          at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

          at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

          at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)

          at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)

          at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

          at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

          at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

          at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

          at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

          at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)

          at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)

          at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

          at java.lang.reflect.Method.invoke(Method.java:601)

          at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)

          at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)

          at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)

          at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)

          at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)

           

          -Steve

          • 2. Re: Simple test failing in Glassfish Remote Container: Module type not recognized for module
            nick.graves

            One possible solution is to manually remove the previously deployed application in the $GLASSFISH_HOME\domains\domain1\applications\ folder.  It seems that a previously failed deployment can cause the redployment error.  Make sure to remove the parent folder of the application.

            • 3. Re: Simple test failing in Glassfish Remote Container: Module type not recognized for module
              sfriesen

              That was the problem. Glassfish is deploying the Arquillian test deployments to a directory called "test" in the domain\applications folder. Even though the application that is created by ShrinkWrap is undeployed after the tests are run, the "test" directory is left there (the jar is removed). Once I deleted the test directory and re-deployed everything worked. Thanks for the answer.

               

              -Steve