0 Replies Latest reply on Apr 9, 2013 3:15 AM by asoldino

    Arquillian test ear libraries issue

    asoldino Newbie

      Hello everyone, it's my first post here, and i would like to thank you for the good work

       

      I am a junior programmer trying to convince my company to use arquillian for testing. We use developing a J2EE 5 compliant framework, going to be compatible with jboss as 7, weblogic 10.3 and websphere 7. We are using Maven as project management tool. This makes arquillian a natural choice for testing due to extreme flexibility with deployments and container options, and integration with Maven.

       

      I have a little problem with an integration test deployment. Basically, in my tests i'm building the output of an ear assembly, stripping it from the main web-app and letting arqullian put its test war with servlet 2.5 protocol support. Everything works fine in standard ear packaging, but with weblogic support constraint we are forced to put ear libraries in APP-INF/lib directory. So the ear package produced by @Deployment method looks like this:

       

       

      main.ear:

      /resource.jar

      /function.jar

      /testJar.jar

      /function-runner.jar

      /core.jar

      /APP-INF/

      /APP-INF/lib/

      /APP-INF/lib/gepe_caspens-0.6.3.64gc.jar

      ...

      /META-INF/

      /META-INF/jboss-deployment-structure.xml

      /META-INF/weblogic-application.xml

      /META-INF/application.xml

      /jboss-seam-2.2.2.Final.jar

      /procedure.jar

      /presentation.jar

       

       

       

      Note that i'm not going to put a war inside it. Before deploying to container (in this case jboss as 7.1.1 Final), arquillian puts its arquillian-protocol.war inside main.ear, along to some dependencies in /lib folder. The test can't run because the ear library directory is APP-INF/lib. Deployed ear looks like this:

       

      main.ear:

      /resource.jar

      /function.jar

      /testJar.jar

      /function-runner.jar

      /core.jar

      /APP-INF/

      /APP-INF/lib/

      /APP-INF/lib/gepe_caspens-0.6.3.64gc.jar

      ...

      /META-INF/

      /META-INF/jboss-deployment-structure.xml

      /META-INF/weblogic-application.xml

      /META-INF/application.xml

      /arquillian-protocol.war

      /jboss-seam-2.2.2.Final.jar

      /procedure.jar

      /presentation.jar

      /lib/arquillian-core.jar                                       

      /lib/arquillian-testenricher-msc.jar                        

      /lib/arquillian-testenricher-cdi.jar                       

      /lib/arquillian-testenricher-resource.jar             

      /lib/arquillian-testenricher-initialcontext.jar      

      /lib/arquillian-core.jar                                      

      /lib/arquillian-testenricher-osgi.jar

      /lib/arquillian-junit.jar

      /lib/arquillian-testenricher-ejb.jar

       

       

       

      Here is error stacktrace:

       

       

      08:41:37,611 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.subunit."main.ear"."arquillian-protocol.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."main.ear"."arquillian-protocol.war".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "arquillian-protocol.war" of deployment "main.ear"

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.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$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_39]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_39]

                at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_39]

      Caused by: java.lang.RuntimeException: Error getting reflective information for class org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner with ClassLoader ModuleClassLoader for Module "deployment.main.ear.arquillian-protocol.war:main" from Service Module Loader

                at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)

                at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)

                at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)

                at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                ... 5 more

      Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/test/spi/TestResult

                at java.lang.Class.getDeclaredMethods0(Native Method) [rt.jar:1.6.0_39]

                at java.lang.Class.privateGetDeclaredMethods(Class.java:2436) [rt.jar:1.6.0_39]

                at java.lang.Class.getDeclaredMethods(Class.java:1793) [rt.jar:1.6.0_39]

                at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:65) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

                ... 10 more

      Caused by: java.lang.ClassNotFoundException: org.jboss.arquillian.test.spi.TestResult from [Module "deployment.main.ear.arquillian-protocol.war: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.performLoadClassChecked(ConcurrentClassLoader.java:423)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                ... 15 more

       

       

       

       

      Is there a way to let arquillian manage this kind of ear libraries configuration to make tests work?

       

      I apologize for my english and thank you for your attention.