5 Replies Latest reply on Nov 29, 2011 6:39 PM by Hanspeter Gisler

    arquillian-testng-container fails with testng version 6.3

    Hanspeter Gisler Newbie

      Hi,

       

      Using in my project:

       

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

       

      and testng version 6.3:

       

            <dependency>
               <groupId>org.testng</groupId>
               <artifactId>testng</artifactId>
               <version>6.3</version>
               <scope>test</scope>
            </dependency>
      

       

      Then the container (glassfish) does not find:

      enum java.lang.NoClassDefFoundError: org/testng/internal/AnnotationTypeEnum
      

       

      because this enum doesn't exist anymore in testng version 6.3, but arquillian-testng-container declares its dependency on testng as provided:

            <dependency>
               <groupId>org.testng</groupId>
               <artifactId>testng</artifactId>
               <scope>provided</scope>
            </dependency>
      

       

      This is a problem.

       

      How best solve it if I stull want to use newest verison of testng?

        • 1. Re: arquillian-testng-container fails with testng version 6.3
          Aslak Knutsen Master

          This is fixed in Arquillian CR6..

          1 of 1 people found this helpful
          • 2. Re: arquillian-testng-container fails with testng version 6.3
            Hanspeter Gisler Newbie

            Thank you.

             

            But now a new problem appears:

                 arquillian-testng-container-1.0.0.CR6

             

            doesn't seem compatible anymore with

                 arquillian-glassfish-remote-3.1-1.0.0.CR2 (and there is no newer version available)

             

            I assume I still need this one for galssfish, don't I?

             

            arquillian-glassfish-remote-3.1 1.0.0.CR2 depends on arquillian-container-spi-1.0.0.CR5 and somehow this one takes precedence when linking (I see that in my maven test-dependencies tree in netbeans), so arquillen doesn't find class StartSuiteContainers, which is obviously new in CR6 and thus can't be found in CR5.

             

            Any ideas how to solve this?

             

             

            ----------------------------------

             

            Btw: here is the stacktrace:

             

            Tests run: 4, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 0.298 sec <<< FAILURE!

            arquillianBeforeSuite(com.company.prj.ocm.ArquillianBasicWebArchiveTest)  Time elapsed: 0 sec  <<< FAILURE!

            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.testng.Arquillian.arquillianBeforeSuite(Arquillian.java:64)

                      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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:74)

                      at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525)

                      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202)

                      at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:130)

                      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:260)

                      at org.testng.SuiteRunner.run(SuiteRunner.java:223)

                      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

                      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

                      at org.testng.TestNG.runSuitesSequentially(TestNG.java:995)

                      at org.testng.TestNG.runSuitesLocally(TestNG.java:920)

                      at org.testng.TestNG.run(TestNG.java:856)

                      at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:70)

                      at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:109)

                      at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:111)

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

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

                      at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)

                      at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)

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

            Caused by: java.lang.reflect.InvocationTargetException

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                      at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

                      at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:166)

                      ... 29 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)

                      ... 34 more

            Caused by: java.lang.reflect.InvocationTargetException

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                      at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

                      at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:153)

                      ... 36 more

            Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/container/spi/event/StartSuiteContainers

                      at java.lang.Class.getDeclaredMethods0(Native Method)

                      at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)

                      at java.lang.Class.privateGetPublicMethods(Class.java:2562)

                      at java.lang.Class.getMethods(Class.java:1427)

                      at org.jboss.arquillian.core.impl.Reflections.getObserverMethods(Reflections.java:53)

                      at org.jboss.arquillian.core.impl.ExtensionImpl.of(ExtensionImpl.java:51)

                      at org.jboss.arquillian.core.impl.ManagerImpl.createExtensions(ManagerImpl.java:409)

                      at org.jboss.arquillian.core.impl.ManagerImpl.fireProcessing(ManagerImpl.java:344)

                      at org.jboss.arquillian.core.impl.ManagerImpl.<init>(ManagerImpl.java:97)

                      ... 41 more

            Caused by: java.lang.ClassNotFoundException: org.jboss.arquillian.container.spi.event.StartSuiteContainers

                      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

                      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

                      at java.security.AccessController.doPrivileged(Native Method)

                      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

                      at java.lang.ClassLoader.loadClass(ClassLoader.java:423)

                      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

                      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

                      ... 50 more

            Caused by: java.lang.reflect.InvocationTargetException

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                      at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

                      at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:166)

                      ... 29 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)

                      ... 34 more

            Caused by: java.lang.reflect.InvocationTargetException

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

                      at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

                      at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:153)

                      ... 36 more

            Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/container/spi/event/StartSuiteContainers

                      at java.lang.Class.getDeclaredMethods0(Native Method)

                      at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)

                      at java.lang.Class.privateGetPublicMethods(Class.java:2562)

                      at java.lang.Class.getMethods(Class.java:1427)

                      at org.jboss.arquillian.core.impl.Reflections.getObserverMethods(Reflections.java:53)

                      at org.jboss.arquillian.core.impl.ExtensionImpl.of(ExtensionImpl.java:51)

                      at org.jboss.arquillian.core.impl.ManagerImpl.createExtensions(ManagerImpl.java:409)

                      at org.jboss.arquillian.core.impl.ManagerImpl.fireProcessing(ManagerImpl.java:344)

                      at org.jboss.arquillian.core.impl.ManagerImpl.<init>(ManagerImpl.java:97)

                      ... 41 more

            Caused by: java.lang.ClassNotFoundException: org.jboss.arquillian.container.spi.event.StartSuiteContainers

                      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

                      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

                      at java.security.AccessController.doPrivileged(Native Method)

                      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

                      at java.lang.ClassLoader.loadClass(ClassLoader.java:423)

                      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

                      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

                      ... 50 more

            • 3. Re: arquillian-testng-container fails with testng version 6.3
              Hanspeter Gisler Newbie

              Ok, this way it seems to work, though I am not sure, whether this could have some nasty side effects....

               

                         <dependency>

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

                             <artifactId>arquillian-glassfish-remote-3.1</artifactId>

                             <version>1.0.0.CR2</version>

                             <scope>test</scope>

                             <exclusions>

                                <exclusion>

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

                                   <artifactId>arquillian-container-spi</artifactId>

                                </exclusion>

                             </exclusions>

                          </dependency>

               

              What do you think, is this legit?

              • 5. Re: arquillian-testng-container fails with testng version 6.3
                Hanspeter Gisler Newbie

                Aslak, thank you very much!

                This did the trick (I didn't know about boms).

                 

                Regards

                Hanspeter