1 Reply Latest reply on Mar 30, 2012 6:18 AM by Vineet Reynolds

    Weblogic 10.3 + Arquillian: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec

    Mohan Bangalore Newbie

      I am working with Weblogic 10.3 & Arquillian-1.0.0.Alpha5.

      I am trying to run a simple test for in-container testing.

      My test class has below deployment code. I have declared all the dependency in POM.

      I am getting some error due to test-persistence.xml. Do I need to declare this anywhere in the project?

      Thanks in advance!!

       

      @Deployment

        public static JavaArchive createTestArchive() {

           return ShrinkWrap.create(JavaArchive.class, "test.jar")

            .addClasses(RegistrationService.class, RegistrationServiceImpl.class, SeRegistrationBean.class)

            .addAsManifestResource(

               "test-persistence.xml",

              ArchivePaths.create("persistence.xml"));

      }

       

       

      java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.JavaArchive com.tam.cprse.server.RegistrationServiceImplTest.createTestArchive()

                at org.jboss.arquillian.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:166)

                at org.jboss.arquillian.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generateDeployment(AnnotationDeploymentScenarioGenerator.java:100)

                at org.jboss.arquillian.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generate(AnnotationDeploymentScenarioGenerator.java:55)

                at org.jboss.arquillian.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:76)

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

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

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

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

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

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

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

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

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

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

                at org.jboss.arquillian.impl.client.ContainerEventController.execute(ContainerEventController.java:68)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                at org.jboss.arquillian.junit.Arquillian.access$300(Arquillian.java:45)

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

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

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

                at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)

                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Caused by: java.lang.reflect.InvocationTargetException

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

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

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

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

                at org.jboss.arquillian.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:162)

                ... 50 more

      Caused by: java.lang.IllegalArgumentException: test-persistence.xml not found in classloader sun.misc.Launcher$AppClassLoader@fabe9

                at org.jboss.shrinkwrap.impl.base.Validate.notNull(Validate.java:44)

                at org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset.<init>(ClassLoaderAsset.java:64)

                at org.jboss.shrinkwrap.impl.base.asset.ClassLoaderAsset.<init>(ClassLoaderAsset.java:48)

                at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addAsManifestResource(ContainerBase.java:593)

                at com.tam.cprse.server.RegistrationServiceImplTest.createTestArchive(RegistrationServiceImplTest.java:33)

                ... 55 more

       

       

      java.lang.NullPointerException

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

                at org.jboss.arquillian.impl.client.container.ContainerDeployController.undeployManaged(ContainerDeployController.java:99)

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

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

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

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

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

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

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

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

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

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

                at org.jboss.arquillian.impl.client.ContainerEventController.execute(ContainerEventController.java:74)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                at org.jboss.arquillian.impl.EventTestRunnerAdaptor.afterClass(EventTestRunnerAdaptor.java:77)

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

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

                at org.jboss.arquillian.junit.Arquillian.access$300(Arquillian.java:45)

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

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

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

                at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)

                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

        • 1. Re: Weblogic 10.3 + Arquillian: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec
          Vineet Reynolds Apprentice

          Couple of points:

           

          1. .addAsManifestResource("test-persistence.xml", ArchivePaths.create("persistence.xml") will result in ShrinkWrap looking for a file named test-persistence.xml in your classpath, and add it to the JAR as META-INF/persistence.xml. I suspect that the file is located in META-INF/test-persistence.xml in the classpath, so you should instead use .addAsManifestResource("META-INF/test-persistence.xml",  ArchivePaths.create("persistence.xml")

          2. Arquillian-Core 1.0.0.Alpha5 is old. I don't think the WLS container adapter can work with that version of Arquillian-Core. Use Arquillan Core 1.0.0.CR7 and Arquillian WLS 1.0.0.Alpha2.

          1 of 1 people found this helpful