6 Replies Latest reply on Nov 12, 2013 4:39 AM by Vineet Reynolds

    Could not create new instance of class EventTestRunnerAdaptor

    Conor Restall Newbie

      Hello,

       

      I am trying to get Arquillian running, but when I attempt to run the tests I get the following error.

       

      java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor
        at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:160)
        at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:111)
        at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:97)
        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(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
        at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
        at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
        at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
        at org.testng.SuiteRunner.privateRun(SuiteRunner.java:277)
        at org.testng.SuiteRunner.run(SuiteRunner.java:240)
        at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
        at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
        at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
        at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
        at org.testng.TestNG.run(TestNG.java:1057)
        at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
        at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
        at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
      Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:156)
        ... 22 more
      Caused by: java.lang.NoSuchMethodError: org.jboss.shrinkwrap.descriptor.api.DescriptorImporter.fromString(Ljava/lang/String;)Lorg/jboss/shrinkwrap/descriptor/api/Descriptor;
        at org.jboss.arquillian.config.impl.extension.ConfigurationSysPropResolver.resolveSystemProperties(ConfigurationSysPropResolver.java:55)
        at org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.loadConfiguration(ConfigurationRegistrar.java:54)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
        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:135)
        at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
        at org.jboss.arquillian.core.impl.ManagerImpl.start(ManagerImpl.java:261)
        at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:56)
        ... 27 more
      
      

       

      I've seen that this error appears to be relatively frequent and i'm pretty sure the problem is in my pom.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
          <modelVersion>4.0.0</modelVersion>
          <parent>
              <artifactId>master</artifactId>
              <groupId>com.home</groupId>
              <version>6.1-SNAPSHOT</version>
              <relativePath>..</relativePath>
          </parent>
          <artifactId>api</artifactId>
          <packaging>war</packaging>
          <name>api</name>
          <properties>
              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
          </properties>
          <build>
              <finalName>api</finalName>
              <resources>
                  <resource>
                      <directory>src/main/resources</directory>
                  </resource>
                  <resource>
                      <directory>src/main/resources/properties</directory>
                      <filtering>true</filtering>
                  </resource>
              </resources>
              <plugins>
                  <plugin>
                      <artifactId>maven-resources-plugin</artifactId>
                      <version>2.5</version>
                      <executions>
                          <execution>
                              <id>copy-resources</id>
                              <phase>validate</phase>
                              <goals>
                                  <goal>copy-resources</goal>
                              </goals>
                              <configuration>
                                  <outputDirectory>${basedir}/target/classes</outputDirectory>
                                  <resources>
                                      <resource>
                                          <directory>src/main/webapp/WEB-INF</directory>
                                          <!-- <includes> <include>app.properties</include> </includes> -->
                                      </resource>
                                  </resources>
                              </configuration>
                          </execution>
                      </executions>
                  </plugin>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-war-plugin</artifactId>
                      <version>2.2</version>
                      <configuration>
                          <dependentWarExcludes>WEB-INF/web.xml</dependentWarExcludes>
                          <webResources>
                              <resource>
                                  <directory>${basedir}/src/main/webapp/WEB-INF</directory>
                                  <!-- <includes> <include>app.properties</include> </includes> -->
                                  <targetPath>WEB-INF/classes</targetPath>
                              </resource>
                          </webResources>
                      </configuration>
                  </plugin>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <configuration>
                          <source>1.7</source>
                          <target>1.7</target>
                          <optimize>true</optimize>
                      </configuration>
                  </plugin>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-surefire-plugin</artifactId>
                      <version>2.11</version>
                      <configuration>
                          <includes>
                              <include>**/*Test.java</include>
                          </includes>
                          <systemProperties>
                              <property>
                                  <name>jetty-embedded</name>
                                  <value>active</value>
                              </property>
                          </systemProperties>
                      </configuration>
                  </plugin>
                  <plugin>
                      <groupId>org.mortbay.jetty</groupId>
                      <artifactId>jetty-maven-plugin</artifactId>
                      <version>8.1.12.v20130726</version>
                      <configuration>
                          <webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
                          <webAppConfig>
                              <jettyEnvXml>${basedir}/jetty-env.xml</jettyEnvXml>
                              <contextPath>/billbusterapi</contextPath>
                              <sessionHandler implementation="org.eclipse.jetty.server.session.SessionHandler">
                                  <sessionManager implementation="org.eclipse.jetty.server.session.HashSessionManager">
                                      <usingCookies>false</usingCookies>
                                  </sessionManager>
                              </sessionHandler>
                          </webAppConfig>
                      </configuration>
                  </plugin>
              </plugins>
              <pluginManagement>
                  <plugins>
                      <!--This plugin's configuration is used to store Eclipse m2e settings
        only. It has no influence on the Maven build itself. -->
                      <plugin>
                          <groupId>org.eclipse.m2e</groupId>
                          <artifactId>lifecycle-mapping</artifactId>
                          <version>1.0.0</version>
                          <configuration>
                              <lifecycleMappingMetadata>
                                  <pluginExecutions>
                                      <pluginExecution>
                                          <pluginExecutionFilter>
                                              <groupId>org.codehaus.mojo</groupId>
                                              <artifactId>jaxb2-maven-plugin</artifactId>
                                              <versionRange>[1.3.1,)</versionRange>
                                              <goals>
                                                  <goal>xjc</goal>
                                              </goals>
                                          </pluginExecutionFilter>
                                          <action>
                                              <ignore />
                                          </action>
                                      </pluginExecution>
                                  </pluginExecutions>
                              </lifecycleMappingMetadata>
                          </configuration>
                      </plugin>
                  </plugins>
              </pluginManagement>
          </build>
          <dependencies>
                ...
              <!-- testing -->
              <dependency>
                  <groupId>org.testng</groupId>
                  <artifactId>testng</artifactId>
                  <version>6.8</version>
                  <scope>test</scope>
              </dependency>
      
              <dependency>
                  <groupId>org.jboss.arquillian</groupId>
                  <artifactId>arquillian-bom</artifactId>
                  <version>1.1.1.Final</version>
                  <scope>import</scope>
                  <type>pom</type>
              </dependency>
      
              <dependency>
                  <groupId>org.jboss.arquillian.testng</groupId>
                  <artifactId>arquillian-testng-container</artifactId>
                  <version>1.1.1.Final</version>
                  <scope>test</scope>
              </dependency>
      
              <dependency>
                  <groupId>org.eclipse.jetty</groupId>
                  <artifactId>jetty-server</artifactId>
                  <version>9.0.5.v20130815</version>
                  <scope>test</scope>
              </dependency>
      
              <dependency>
                  <groupId>org.jboss.arquillian.container</groupId>
                  <artifactId>arquillian-jetty-embedded-9</artifactId>
                  <version>1.0.0.CR2</version>
                  <scope>test</scope>
              </dependency>
      
          </dependencies>
      </project>
      
      

       

      Here is my test not that it does anything atm

       

      package com.api.web.controller;
      
      
      import org.testng.annotations.Test;
      import org.testng.AssertJUnit;
      import java.io.File;
      
      
      import org.jboss.arquillian.container.test.api.Deployment;
      import org.jboss.arquillian.testng.Arquillian;
      import org.jboss.shrinkwrap.api.ShrinkWrap;
      import org.jboss.shrinkwrap.api.spec.WebArchive;
      
      
      public class ApiControllerTest extends Arquillian
      {
        @Deployment
          public static WebArchive createDeployment() {
              return ShrinkWrap.create(WebArchive.class, "test.war").addClass(ApiController.class).
                             addAsWebResource(new File("src/main/webapp/WEB-INF/billbusterapi-context.xml")).
                             addAsWebInfResource(new File("jetty-env.xml"), "jetty-env.xml").
                             setWebXML(new File("src/main/webapp/WEB-INF/web.xml"));
      
      
          }
          @Test(dataProvider = Arquillian.ARQUILLIAN_DATA_PROVIDER)
        public void should_create_greeting() {
              AssertJUnit.assertTrue(false);//("Not yet implemented");
          }
      }
      
      

       

      Many Thanks

       

      Conor

        • 1. Re: Could not create new instance of class EventTestRunnerAdaptor
          Bartosz Majsak Master

          Looks like library conflicts on the classpath to me. Most likely you have two different versions of Shrinkwrap.

           

          Can you share the output from mvn dependency:tree?

          • 2. Re: Could not create new instance of class EventTestRunnerAdaptor
            Conor Restall Newbie

            It looks like the problem was with arquillian-jetty-embedded-9 included lots of old shrinkwrap and jetty stuff

             

            Thanks

            • 3. Re: Could not create new instance of class EventTestRunnerAdaptor
              b69 Newbie

              Hi Bartosz,

               

              I must have a similar problem, but as I use all those bom-poms, I don't see how to resolve it. Here is the partial dependencyManagement section of the parent pom:

              <dependencyManagement>

                 <dependencies>

                  <dependency>

                      <groupId>javax</groupId>

                      <artifactId>javaee-api</artifactId>

                      <version>6.0</version>

                      <scope>provided</scope>

                  </dependency>

                  <dependency>

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

                      <artifactId>arquillian-bom</artifactId>

                      <version>1.1.1.Final</version>

                      <type>pom</type>               

                      <scope>import</scope>

                  </dependency>

                  <dependency>

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

                      <artifactId>arquillian-drone-bom</artifactId>

                      <version>2.35.0</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

                  <dependency>

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

                      <artifactId>selenium-bom</artifactId>

                      <version>2.35.0</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

                      <dependency>

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

                      <artifactId>arquillian-drone-webdriver-depchain</artifactId>

                      <version>1.2.0.Beta2</version>

                      <type>pom</type>

                      <scope>import</scope>

                  </dependency>

               

              The dependencies declaration within the module under test is:

              <dependency>

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

                  <artifactId>graphene-webdriver-api</artifactId>

                  <version>2.0.0.Beta1</version>

                  <scope>test</scope>

              </dependency>

              <dependency>

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

                  <artifactId>graphene-webdriver-spi</artifactId>

                  <version>2.0.0.Beta1</version>

                  <scope>test</scope>

              </dependency>

              <dependency>

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

                  <artifactId>graphene-webdriver-impl</artifactId>

                  <version>2.0.0.Beta1</version>

                  <scope>test</scope>

              </dependency>

              <dependency>

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

                  <artifactId>arquillian-drone-webdriver-depchain</artifactId>

                  <type>pom</type>

                  <scope>test</scope>

              </dependency>

               

              On running the JunitTest I get the RuntimeException as mentioned, i.e.:

              java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor

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

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

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

                  at org.jboss.arquillian.test.spi.TestRunnerAdaptorBuilder.build(TestRunnerAdaptorBuilder.java:52)

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

                  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.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:156)

                  ... 10 more

              Caused by: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal

                  at java.lang.ClassLoader.defineClass1(Native Method)

                  at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)

                  at java.lang.ClassLoader.defineClass(ClassLoader.java:615)

                  at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

                  at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

                  at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

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

                  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)

                  at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown Source)

                  at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown Source)

                  at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown Source)

                  at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)

                  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

                  at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

                  at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

                  at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

                  at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)

                  at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)

                  at org.jboss.shrinkwrap.descriptor.spi.node.dom.XmlDomNodeImporterImpl.importAsNode(XmlDomNodeImporterImpl.java:68)

                  at org.jboss.shrinkwrap.descriptor.spi.node.dom.XmlDomNodeImporter.importAsNode(XmlDomNodeImporter.java:46)

                  at org.jboss.shrinkwrap.descriptor.spi.node.NodeDescriptorImporterBase.fromStream(NodeDescriptorImporterBase.java:72)

                  at org.jboss.shrinkwrap.descriptor.spi.DescriptorImporterBase.fromStream(DescriptorImporterBase.java:155)

                  at org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.resolveDescriptor(ConfigurationRegistrar.java:69)

                  at org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.loadConfiguration(ConfigurationRegistrar.java:52)

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

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

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

                  at org.jboss.arquillian.core.impl.ManagerImpl.start(ManagerImpl.java:261)

                  at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.<init>(EventTestRunnerAdaptor.java:56)

                  ... 15 more

              Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal

                  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)

                  ... 54 more

              This happens before entering the WebArchive createDeployment() .. method.

               

              mvn dependency:tree results in:

               

              [INFO]

              [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ MonteRosaJSF-GF ---

              [INFO] ch.commcity.monterosa:MonteRosaJSF-GF:war:1.0.30

              [INFO] +- ch.commcity.monterosa:MonteRosaEJB-GF:ejb:1.0.30:provided

              [INFO] |  \- com.ibm.websphere:jgss-provider:jar:8.5.0:system

              [INFO] +- ch.commcity.monterosa:MonteRosaCommon:jar:1.0.30:provided

              [INFO] +- org.apache.myfaces.tomahawk:tomahawk21:jar:1.1.14:compile

              [INFO] |  +- commons-logging:commons-logging:jar:1.1.1:compile

              [INFO] |  +- commons-validator:commons-validator:jar:1.3.1:compile

              [INFO] |  |  +- commons-beanutils:commons-beanutils:jar:1.7.0:compile

              [INFO] |  |  \- commons-digester:commons-digester:jar:1.6:compile

              [INFO] |  |     \- xml-apis:xml-apis:jar:1.0.b2:compile

              [INFO] |  +- commons-fileupload:commons-fileupload:jar:1.2.1:compile

              [INFO] |  +- commons-io:commons-io:jar:1.3.2:runtime

              [INFO] |  +- commons-collections:commons-collections:jar:3.2.1:compile

              [INFO] |  +- commons-codec:commons-codec:jar:1.3:compile

              [INFO] |  +- oro:oro:jar:2.0.8:compile

              [INFO] |  +- commons-lang:commons-lang:jar:2.4:compile

              [INFO] |  +- javax.servlet:jstl:jar:1.2:compile

              [INFO] |  \- batik:batik-awt-util:jar:1.6-1:compile

              [INFO] |     \- batik:batik-util:jar:1.6-1:compile

              [INFO] |        \- batik:batik-gui-util:jar:1.6-1:compile

              [INFO] |           \- batik:batik-ext:jar:1.6-1:compile

              [INFO] |              \- xml-apis:xmlParserAPIs:jar:2.0.2:compile

              [INFO] +- org.jboss.arquillian.graphene:graphene-webdriver-api:jar:2.0.0.Beta1:test

              [INFO] +- org.jboss.arquillian.graphene:graphene-webdriver-spi:jar:2.0.0.Beta1:test

              [INFO] |  +- org.jboss.arquillian.core:arquillian-core-spi:jar:1.1.1.Final:test

              [INFO] |  |  \- org.jboss.arquillian.core:arquillian-core-api:jar:1.1.1.Final:test

              [INFO] |  \- org.jboss.arquillian.test:arquillian-test-spi:jar:1.1.1.Final:test

              [INFO] |     \- org.jboss.arquillian.test:arquillian-test-api:jar:1.1.1.Final:test

              [INFO] +- org.jboss.arquillian.graphene:graphene-webdriver-impl:jar:2.0.0.Beta1:test

              [INFO] |  +- org.jboss.arquillian.extension:arquillian-drone-impl:jar:1.2.0.Beta2:test

              [INFO] |  +- org.jboss.arquillian.extension:arquillian-drone-configuration:jar:1.2.0.Beta2:test

              [INFO] |  +- org.jboss.arquillian.config:arquillian-config-api:jar:1.1.1.Final:test

              [INFO] |  |  \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-api-base:jar:2.0.0-alpha-3:test

              [INFO] |  +- org.jboss.arquillian.container:arquillian-container-spi:jar:1.1.1.Final:test

              [INFO] |  |  +- org.jboss.arquillian.config:arquillian-config-impl-base:jar:1.1.1.Final:test

              [INFO] |  |  |  \- org.jboss.shrinkwrap.descriptors:shrinkwrap-descriptors-spi:jar:2.0.0-alpha-3:test

              [INFO] |  |  \- org.jboss.shrinkwrap:shrinkwrap-api:jar:1.1.2:test

              [INFO] |  \- org.jboss.arquillian.container:arquillian-container-test-spi:jar:1.1.1.Final:test

              [INFO] |     \- org.jboss.arquillian.container:arquillian-container-test-api:jar:1.1.1.Final:test

              [INFO] +- org.jboss.arquillian.extension:arquillian-drone-webdriver-depchain:pom:1.2.0.Beta2:test

              [INFO] |  +- org.jboss.arquillian.extension:arquillian-drone-api:jar:1.2.0.Beta2:test

              [INFO] |  +- org.jboss.arquillian.extension:arquillian-drone-spi:jar:1.2.0.Beta2:test

              [INFO] |  +- org.jboss.arquillian.extension:arquillian-drone-webdriver:jar:1.2.0.Beta2:test

              [INFO] |  +- org.seleniumhq.selenium:selenium-api:jar:2.35.0:test

              [INFO] |  |  +- com.google.guava:guava:jar:14.0:test

              [INFO] |  |  \- org.json:json:jar:20080701:test

              [INFO] |  +- org.seleniumhq.selenium:selenium-java:jar:2.35.0:test

              [INFO] |  |  +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.35.0:test

              [INFO] |  |  \- org.webbitserver:webbit:jar:0.4.14:test

              [INFO] |  |     \- io.netty:netty:jar:3.5.2.Final:test

              [INFO] |  +- org.seleniumhq.selenium:selenium-support:jar:2.35.0:test

              [INFO] |  +- org.seleniumhq.selenium:selenium-android-driver:jar:2.35.0:test

              [INFO] |  +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.35.0:test

              [INFO] |  +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.35.0:test

              [INFO] |  |  \- org.apache.commons:commons-exec:jar:1.1:test

              [INFO] |  +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.35.0:test

              [INFO] |  |  +- net.sourceforge.htmlunit:htmlunit:jar:2.12:test

              [INFO] |  |  |  +- xalan:xalan:jar:2.7.1:test

              [INFO] |  |  |  |  \- xalan:serializer:jar:2.7.1:test

              [INFO] |  |  |  +- org.apache.commons:commons-lang3:jar:3.1:test

              [INFO] |  |  |  +- org.apache.httpcomponents:httpmime:jar:4.2.3:test

              [INFO] |  |  |  +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.12:test

              [INFO] |  |  |  +- xerces:xercesImpl:jar:2.10.0:test

              [INFO] |  |  |  +- net.sourceforge.nekohtml:nekohtml:jar:1.9.18:test

              [INFO] |  |  |  +- net.sourceforge.cssparser:cssparser:jar:0.9.9:test

              [INFO] |  |  |  |  \- org.w3c.css:sac:jar:1.3:test

              [INFO] |  |  |  \- org.eclipse.jetty:jetty-websocket:jar:8.1.9.v20130131:test

              [INFO] |  |  |     +- org.eclipse.jetty:jetty-util:jar:8.1.9.v20130131:test

              [INFO] |  |  |     +- org.eclipse.jetty:jetty-io:jar:8.1.9.v20130131:test

              [INFO] |  |  |     \- org.eclipse.jetty:jetty-http:jar:8.1.9.v20130131:test

              [INFO] |  |  \- org.apache.httpcomponents:httpclient:jar:4.2.1:test

              [INFO] |  |     \- org.apache.httpcomponents:httpcore:jar:4.2.1:test

              [INFO] |  +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.35.0:test

              [INFO] |  |  +- net.java.dev.jna:jna:jar:3.4.0:test

              [INFO] |  |  \- net.java.dev.jna:platform:jar:3.4.0:test

              [INFO] |  +- org.seleniumhq.selenium:selenium-iphone-driver:jar:2.35.0:test

              [INFO] |  +- org.seleniumhq.selenium:selenium-remote-driver:jar:2.35.0:test

              [INFO] |  |  \- cglib:cglib-nodep:jar:2.1_3:test

              [INFO] |  +- com.opera:operadriver:jar:1.5:test

              [INFO] |  |  +- com.opera:operalaunchers:jar:1.1:test

              [INFO] |  |  +- com.google.protobuf:protobuf-java:jar:2.4.1:test

              [INFO] |  |  +- commons-jxpath:commons-jxpath:jar:1.3:test

              [INFO] |  |  \- org.ini4j:ini4j:jar:0.5.2:test

              [INFO] |  \- org.jboss.arquillian.extension:arquillian-phantom-driver:jar:1.1.0.Beta1:test

              [INFO] |     +- com.github.detro.ghostdriver:phantomjsdriver:jar:1.0.4:test

              [INFO] |     |  \- org.seleniumhq.selenium:selenium-server:jar:2.35.0:test

              [INFO] |     |     +- org.bouncycastle:bcprov-jdk15on:jar:1.48:test

              [INFO] |     |     +- org.bouncycastle:bcpkix-jdk15on:jar:1.48:test

              [INFO] |     |     +- mx4j:mx4j-tools:jar:3.0.1:test

              [INFO] |     |     +- org.mortbay.jetty:servlet-api-2.5:jar:6.1.9:test

              [INFO] |     |     +- org.seleniumhq.selenium:jetty-repacked:jar:7.6.1:test

              [INFO] |     |     +- net.jcip:jcip-annotations:jar:1.0:test

              [INFO] |     |     \- org.yaml:snakeyaml:jar:1.8:test

              [INFO] |     \- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-depchain:pom:2.0.0:test

              [INFO] |        +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api:jar:2.0.0:test

              [INFO] |        +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi:jar:2.0.0:test

              [INFO] |        +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven:jar:2.0.0:test

              [INFO] |        +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi-maven:jar:2.0.0:test

              [INFO] |        +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven:jar:2.0.0:test

              [INFO] |        |  +- org.sonatype.aether:aether-api:jar:1.13.1:test

              [INFO] |        |  +- org.sonatype.aether:aether-impl:jar:1.13.1:test

              [INFO] |        |  +- org.sonatype.aether:aether-spi:jar:1.13.1:test

              [INFO] |        |  +- org.sonatype.aether:aether-util:jar:1.13.1:test

              [INFO] |        |  +- org.sonatype.aether:aether-connector-wagon:jar:1.13.1:test

              [INFO] |        |  +- org.apache.maven:maven-aether-provider:jar:3.0.5:test

              [INFO] |        |  +- org.apache.maven:maven-model:jar:3.0.5:test

              [INFO] |        |  +- org.apache.maven:maven-model-builder:jar:3.0.5:test

              [INFO] |        |  +- org.apache.maven:maven-repository-metadata:jar:3.0.5:test

              [INFO] |        |  +- org.apache.maven:maven-settings:jar:3.0.5:test

              [INFO] |        |  +- org.apache.maven:maven-settings-builder:jar:3.0.5:test

              [INFO] |        |  +- org.codehaus.plexus:plexus-interpolation:jar:1.14:test

              [INFO] |        |  +- org.codehaus.plexus:plexus-utils:jar:2.0.6:test

              [INFO] |        |  +- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4:test

              [INFO] |        |  |  \- org.sonatype.plexus:plexus-cipher:jar:1.4:test

              [INFO] |        |  +- org.apache.maven.wagon:wagon-provider-api:jar:2.4:test

              [INFO] |        |  +- org.apache.maven.wagon:wagon-file:jar:2.4:test

              [INFO] |        |  \- org.apache.maven.wagon:wagon-http-lightweight:jar:2.4:test

              [INFO] |        |     \- org.apache.maven.wagon:wagon-http-shared4:jar:2.4:test

              [INFO] |        |        \- org.jsoup:jsoup:jar:1.7.1:test

              [INFO] |        \- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven-archive:jar:2.0.0:test

              [INFO] |           +- org.jboss.shrinkwrap:shrinkwrap-impl-base:jar:1.1.2:test

              [INFO] |           |  \- org.jboss.shrinkwrap:shrinkwrap-spi:jar:1.1.2:test

              [INFO] |           +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-maven-archive:jar:2.0.0:test

              [INFO] |           +- org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-spi-maven-archive:jar:2.0.0:test

              [INFO] |           +- org.codehaus.plexus:plexus-compiler-javac:jar:2.1:test

              [INFO] |           |  \- org.codehaus.plexus:plexus-compiler-api:jar:2.1:test

              [INFO] |           \- org.codehaus.plexus:plexus-component-api:jar:1.0-alpha-33:test

              [INFO] |              \- org.codehaus.plexus:plexus-classworlds:jar:1.2-alpha-10:test

              [INFO] \- junit:junit:jar:4.10:test

              [INFO]    \- org.hamcrest:hamcrest-core:jar:1.1:test

              [INFO] ------------------------------------------------------------------------

              [INFO] BUILD SUCCESS

              [INFO] ------------------------------------------------------------------------

              [INFO] Total time: 2.465s

              [INFO] Finished at: Fri Sep 20 09:21:23 CEST 2013

              [INFO] Final Memory: 18M/213M

              [INFO] ------------------------------------------------------------------------

               

              I can see we have several ShrinkWrap versions. But, all are imported by the poms, I don't know how to influence it.

               

              For the moment, even a workaround would make me happy.

              Thanks

              Juerg

              • 4. Re: Re: Could not create new instance of class EventTestRunnerAdaptor
                Conor Restall Newbie

                Hi Juerg,

                 

                Try adding

                 

                <dependency>
                    <groupId>org.apache.xmlgraphics</groupId>
                    <artifactId>batik-ext</artifactId>
                    <version>1.7</version>
                </dependency>
                

                 

                If that doesn't work you will need to exclude batik:batik-ext from tomahawk:tomahawk21

                • 5. Re: Re: Could not create new instance of class EventTestRunnerAdaptor
                  b69 Newbie

                  Hi Connor,

                  Thanks! This works! So I must conclude, graphene has a dependency of this version of batik-ext, which is not included within the graphene pom or ignored when the different version used by Tomahawk is already referenced? What do you know about this rather unhappy combination?

                  Anyway with the download of batik-ext-1.7.jar I could resolve the issue. But doing an exclude from tomahawk didn’t change anything.

                  A big step forward. At least until the failure of starting  embedded glassfish container. Start of Exception log is:

                  SEVERE: PWC1420: Error invoking ServletContainerInitializer org.apache.jasper.runtime.TldScannerjava.lang.NoSuchMethodError: javax.servlet.ServletContext.getServletRegistration(Ljava/lang/String;)Ljavax/servlet/ServletRegistration;

                  Have you already tried this container together with graphene? Though I have JBoss 7 server installed on my test machine, I would prefer to work with glassfish, as all other tests work already within this environment! Any Idea?

                  • 6. Re: Could not create new instance of class EventTestRunnerAdaptor
                    Vineet Reynolds Apprentice

                    I just resolved this in a different project. Apparently this error occurs when an older version of the Servlet API is present in the test classpath. Usually running "mvn dependency:tree" would reveal the culprit and you can exclude the older servlet API dependency.

                     

                    If the dependency loading the older version is difficult to track, then I'd recommend adding this snippet to your project POM:

                     

                    <build>

                        <plugins>

                            <plugin>

                                <groupId>org.apache.maven.plugins</groupId>

                                <artifactId>maven-surefire-plugin</artifactId>

                                <configuration>

                                    <argLine>-verbose:class</argLine>

                                </configuration>

                            </plugin>

                        </plugins>

                    </build>

                     

                    It emits classloading behavior for the JVM launched by Surefire to run the Arquillian tests. Studying the classloading behavior to detect the JAR used to load "javax.servlet.ServletContext" reveals the dependency that should not be used to load the servlet API. In the project I just fixed, it was the Apache WSS4J library that was loading an older version of the Servlet API (2.3 or 2.4 in a Servlet 3.0 container).

                     

                    You could proceed to exclude offending dependencies from the project dependency tree (if you can exclude them without changing the expected behaviour of the system), or you could attempt to exclude them only from the test classpath (via Surefire configuration). The best course of action is to however use the managed or remote container instead of the embedded container, to enforce the classloader hierarchies found in the real environment.