1 Reply Latest reply on Oct 8, 2012 2:46 PM by stefan hill

    Could not create a new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor see cause.

    stefan hill Newbie

      I know this is a common problem. After two days of search and try for solutions i write this question.

       

      I start a new Maven project in Eclipse. I choose the following type.

       

      An archetype that generates a starter Java EE 6 webapp project for JBoss AS 7.1 (by default) or EAP 6 (if the "enterprise" property is true). The project is an EAR, with an EJB-JAR and WAR.

      Group Id: org.jboss.spec.archetypes

      Artifact Id: jboss-javaee6-webapp-ear-archetype

       

      If i start a test to test my rest interfaces I get the following errors.

       

      Even I start with a new project with an example in it i get this error.

       

      Dose someone have any idea what’s wrong. Do I have to include some dependencies or something else?

       

       

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

          ... 8 more

      Caused by: org.jboss.arquillian.container.impl.ContainerCreationException: Could not create Container jboss

          at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:85)

          at org.jboss.arquillian.container.impl.client.container.ContainerRegistryCreator.createRegistry(ContainerRegistryCreator.java:76)

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

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

          at org.jboss.arquillian.core.impl.ManagerImpl.bindAndFire(ManagerImpl.java:236)

          at org.jboss.arquillian.core.impl.InstanceImpl.set(InstanceImpl.java:74)

          at org.jboss.arquillian.config.impl.extension.ConfigurationRegistrar.loadConfiguration(ConfigurationRegistrar.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.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)

          ... 13 more

      Caused by: java.lang.IllegalArgumentException: DeployableContainer must be specified

          at org.jboss.arquillian.core.spi.Validate.notNull(Validate.java:44)

          at org.jboss.arquillian.container.impl.ContainerImpl.<init>(ContainerImpl.java:71)

          at org.jboss.arquillian.container.impl.LocalContainerRegistry.create(LocalContainerRegistry.java:76)

          ... 37 more

        • 1. Re: Could not create a new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor see cause.
          stefan hill Newbie

          Solution found!

           

          The problem is a missing dependency respectively the profile arq-jbossas-managed or arq-jbossas-remote was not set.

           

          This section was in the pom but not activated.

          <profile>

          <!-- An optional Arquillian testing profile that executes tests

          in a remote JBoss AS instance -->

          <!-- Run with: mvn clean test -Parq-jbossas-remote -->

          <id>arq-jbossas-remote</id>

          <dependencies>

          <dependency>

          <groupId>org.jboss.as</groupId>

          <artifactId>jboss-as-arquillian-container-remote</artifactId>

          <scope>test</scope>

          </dependency>

          </dependencies>

          </profile>

           

          Activate profiles in Context menu Maven -> Select Profile

          or

          via Properties -> Maven enter profile name in "Active Maven Profiles"