9 Replies Latest reply on Mar 9, 2012 11:54 AM by Marcos Portela

    jboss-as-kitchensink test: UndeclaredThrowableException?

    david meier Newbie

      Hi,

       

      I'm just trying to execute the Arquillian test contained in jboss-as-kitchensink v7.1.0.Beta1b. The deployment itself already runs successfully on jboss-as-web-7.0.2.Final.

       

      What does the following UE tell me?

       

      Thanks a lot!

       

      java.lang.reflect.UndeclaredThrowableException

          at $Proxy17.runTestMethod(Unknown Source)

          at org.jboss.arquillian.protocol.jmx.JMXMethodExecutor.invoke(JMXMethodExecutor.java:69)

          at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.execute(RemoteTestExecuter.java:120)

          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:90)

          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:134)

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

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

          at org.jboss.arquillian.container.test.impl.execution.ClientTestExecuter.execute(ClientTestExecuter.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:90)

          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.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:130)

          at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createTestContext(ContainerEventController.java:117)

          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:90)

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

          at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:82)

          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:90)

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

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

          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:90)

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

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

          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:90)

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

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

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

          at org.jboss.arquillian.junit.Arquillian$6.evaluate(Arquillian.java:239)

          at org.jboss.arquillian.junit.Arquillian$4.evaluate(Arquillian.java:202)

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

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

          at org.jboss.arquillian.junit.Arquillian$5.evaluate(Arquillian.java:216)

          at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)

          at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)

          at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)

          at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)

          at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)

          at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)

          at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)

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

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

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

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

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

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

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

          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.io.IOException: Failed operation: "No handler for operation invoke-mbean-raw at address [(\"subsystem\" => \"jmx\")]"

          at org.jboss.as.arquillian.container.TunneledMBeanServerConnection.invoke(TunneledMBeanServerConnection.java:166)

          at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:305)

          ... 77 more

        • 1. Re: jboss-as-kitchensink test: UndeclaredThrowableException?
          david meier Newbie

          OK, I found out the dependencies have not been right.

           

          Use this and it works (hope it helps other too):

           

            <dependency>
               <groupId>org.jboss.arquillian.junit</groupId>
               <artifactId>arquillian-junit-container</artifactId>
               <version>1.0.0.CR4</version>
               <scope>test</scope>
            </dependency>
           
            <dependency>
               <groupId>org.jboss.arquillian.protocol</groupId>
               <artifactId>arquillian-protocol-servlet</artifactId>
               <version>1.0.0.CR4</version>
               <scope>test</scope>          
            </dependency>
          • 2. Re: jboss-as-kitchensink test: UndeclaredThrowableException?
            Bartosz Majsak Master

            Good that it works for you Would you mind to check with CR7? If it would not work then we might have a regression bug.

             

            Cheers!

            • 3. Re: jboss-as-kitchensink test: UndeclaredThrowableException?
              david meier Newbie

              Maybe the following was my mistake:

               

              jboss-as-kitchensink v7.1.0.Beta1b

              jboss-as-web-7.0.2.Final

               

              Notice that the kitchensink example files are of a newer version than the AS.

              In fact the "final" arquillian.xml looks different, eg has a:

                 <defaultProtocol type="Servlet 3.0" />

              defined. Which does not exist in the beta.

              • 4. Re: jboss-as-kitchensink test: UndeclaredThrowableException?
                Aslak Knutsen Master

                You will get that exception if you have not configured the jmx-as7 protocol with executionMode=REMOTE in arquillian.xml on 7.0.2. this is fixed in > 7.0.2

                • 5. Re: jboss-as-kitchensink test: UndeclaredThrowableException?
                  Gilles Dupont Tagne Tagne Newbie

                  Hi David,

                   

                  I am facing the same problem. The two dependencies are already added to the pom.xml but i am still having the same error. I tested it with the two arquillian configurations

                   

                   

                    <protocol type="jmx-as7">
                    <property name="executionType">REMOTE</property>
                    </protocol>
                  

                   

                  and

                  <protocol type="Servlet 3.0"> 
                       <property name="host">localhost</property> 
                       <property name="port">9999</property> 
                  </protocol>
                  

                   

                  i am still having the same error.

                   

                  I am using the arquillian version 7.1.0.Beta1b with a remote Jboss-as-7.1.0.Final server.

                   

                    <dependency>
                            <groupId>org.jboss.as</groupId>
                            <artifactId>jboss-as-arquillian-container-remote</artifactId>
                            <version>7.1.0.Beta1b</version>
                          <scope>test</scope>
                    </dependency>
                  

                   

                  When i try to use the arquillian version 7.1.0.Final with a remote Jboss-as-7.1.0.Final server.

                   

                   

                    <dependency>
                            <groupId>org.jboss.as</groupId>
                            <artifactId>jboss-as-arquillian-container-remote</artifactId>
                            <version>7.1.0.Final</version>
                          <scope>test</scope>
                    </dependency>
                  
                  

                   

                  i am having this error

                   

                  Running de.gilles.projects.camel.TimePlanerRoutesTest
                  java.lang.reflect.UndeclaredThrowableException
                            at $Proxy0.invoke(Unknown Source)
                            at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
                            at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
                            at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
                  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.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
                            ... 4 more
                  Caused by: java.lang.RuntimeException: Could not create a new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor see cause.
                            at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:170)
                            at org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:52)
                            at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:72)
                            at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
                            at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
                            at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
                            ... 9 more
                  Caused by: java.lang.reflect.InvocationTargetException
                            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                            at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:166)
                            ... 14 more
                  Caused by: java.lang.RuntimeException: Could not create a new instance of class org.jboss.arquillian.core.impl.ManagerImpl see cause.
                            at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:157)
                            at org.jboss.arquillian.core.spi.ManagerBuilder.create(ManagerBuilder.java:77)
                            at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:55)
                            ... 19 more
                  Caused by: java.lang.reflect.InvocationTargetException
                            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                            at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:153)
                            ... 21 more
                  Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/test/spi/enricher/resource/ResourceProvider
                            at org.jboss.as.arquillian.container.CommonContainerExtension.register(CommonContainerExtension.java:36)
                            at org.jboss.as.arquillian.container.remote.RemoteContainerExtension.register(RemoteContainerExtension.java:33)
                            at org.jboss.arquillian.core.impl.loadable.LoadableExtensionLoader.load(LoadableExtensionLoader.java:78)
                            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.core.impl.ObserverImpl.invoke(ObserverImpl.java:90)
                            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:134)
                            at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
                            at org.jboss.arquillian.core.impl.ManagerImpl.fireProcessing(ManagerImpl.java:315)
                            at org.jboss.arquillian.core.impl.ManagerImpl.<init>(ManagerImpl.java:97)
                            ... 26 more
                  Caused by: java.lang.ClassNotFoundException: org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider
                            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
                            at java.security.AccessController.doPrivileged(Native Method)
                            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
                            at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
                            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                            at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
                            ... 40 more
                  

                   

                  what it's wrong with my configuration?

                  or which arquillian version would i use with jboss-as-7.1.0.Final?

                  • 6. Re: jboss-as-kitchensink test: UndeclaredThrowableException?
                    Marcos Portela Newbie

                    I have the same problem, on update 7.0.2.Final to 7.1.0.Final:

                     

                    I was found a reference a class: org.jboss.arquillian.container.test.impl.enricher.resource.ResourceProvider.class on:

                     

                    <dependency>

                    <groupId>org.jboss.arquillian.container</groupId>

                    <artifactId>arquillian-container-test-impl-base</artifactId>

                    <scope>test</scope>                      

                    </dependency>

                     

                    You can see this reference on: https://github.com/jbossas/jboss-as/commit/894391651851a743a61ec2debce0793710fc0681

                     

                    However, In some way, It uses org.jboss.arquillian.test.spi.enricher.resource.ResourceProvider on:

                     

                    <dependency>

                      <groupId>org.jboss.arquillian.test</groupId>

                      <artifactId>arquillian-test-spi</artifactId>

                      <version>test</version>

                      <version>1.0.0.CR6</version>

                    </dependency>

                     

                    I´m trying fix my tests.

                    • 7. Re: jboss-as-kitchensink test: UndeclaredThrowableException?
                      Dominik Grupp Newbie

                      I had the same exception on a different project on JBossAS 7.1.0 as "Gilles Dupont Tagne Tagne" (CNFE). It dissappeared after using the correct versions:

                       

                      <dependency>
                      <groupId>org.jboss.arquillian.junit</groupId>
                      <artifactId>arquillian-junit-container</artifactId>
                      <version>1.0.0.CR7</version>
                      <scope>test</scope>
                      </dependency>

                       

                      together with

                       

                      <dependency>
                      <groupId>org.jboss.as</groupId>
                      <artifactId>jboss-as-arquillian-container-remote</artifactId>
                      <version>7.1.0.Final</version>
                      <scope>test</scope>
                      </dependency>

                       

                      in the pom.

                      • 8. Re: jboss-as-kitchensink test: UndeclaredThrowableException?
                        Jeremy Whiting Expert

                        Hi,

                        Which version did you use for arquillian-container-test-impl-base ?

                         

                        Regards,

                        Jeremy

                        • 9. Re: jboss-as-kitchensink test: UndeclaredThrowableException?
                          Marcos Portela Newbie

                          Hi,

                           

                          The version is managed through "import" maven <scope> org.jboss.arquillian:arquillian-bom:1.0.0.Final-SNAPSHOT.

                           

                          <dependencyManagement>

                                              <dependencies>

                                                        <!-- Aquillian BOM - Bill Of Materials - -->

                                                        <dependency>

                                                                  <groupId>org.jboss.arquillian</groupId>

                                                                  <artifactId>arquillian-bom</artifactId>

                                                                  <version>1.0.0.Final-SNAPSHOT</version>

                                                                  <scope>import</scope>

                                                                  <type>pom</type>

                                                        </dependency>

                                              </dependencies>

                          </dependencyManagement>

                           

                          This is same version: org.jboss.arquillian.container:arquillian-container-test-impl-base:1.0.0.Final-SNAPSHOT.

                           

                          Regards,

                          Marcos.