0 Replies Latest reply: Jul 16, 2012 4:17 PM by Gard Vaaler RSS

Arquillian test runner, JBoss 7.x and modules

Gard Vaaler Newbie

I'm trying to test a component that has several module dependencies. For normal deployments, dependencies are indicated by a "Dependencies" line in the manifest. I've tried the straightforward approach:

     @Deployment
     public static JavaArchive createDeployment() {
          return ShrinkWrap.create(JavaArchive.class)
                    .addClass(FooService.class)
                    .setManifest(new StringAsset("Manifest-Version: 1.0\nDependencies: org.apache.cayenne,org.apache.velocity,org.codehaus.jackson.jackson-core-asl"))
                    ;
     }

However, when running the test from Eclipse, the server (JBoss 7.1.0.GA) emits the following stacktrace:

17:53:13,567 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.unit."5e049303-968c-472a-a232-6902562fdbd5.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."5e049303-968c-472a-a232-6902562fdbd5.jar".POST_MODULE: Failed to process phase POST_MODULE of deployment "5e049303-968c-472a-a232-6902562fdbd5.jar"
     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_04]
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]
     at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]
Caused by: java.lang.RuntimeException: Error getting reflective information for class com.dataloy.vms.modules.VesselReportService with ClassLoader ModuleClassLoader for Module "deployment.5e049303-968c-472a-a232-6902562fdbd5.jar:main" from Service Module Loader
     at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
     at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
     at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:70)
     at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:117)
     at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:54)
     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
     ... 5 more
Caused by: java.lang.NoClassDefFoundError: org/codehaus/jackson/map/JsonMappingException
     at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_04]
     at java.lang.Class.privateGetDeclaredFields(Class.java:2308) [rt.jar:1.7.0_04]
     at java.lang.Class.getDeclaredFields(Class.java:1760) [rt.jar:1.7.0_04]
     at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.(ClassReflectionIndex.java:57) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
     at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
     ... 10 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.map.JsonMappingException from [Module "deployment.5e049303-968c-472a-a232-6902562fdbd5.jar:main" from Service Module Loader]
     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
     ... 15 more

I'm using Arquillian 1.0.1.Final and the Arquillian JUnit remote container for 7.1.0, straight out of the JBoss Ivy repository.

Any ideas?