1 Reply Latest reply on Nov 7, 2011 10:20 AM by Daniel Rosowski

    Arquillian & JBoss 7 results in NullPointerException

    Daniel Rosowski Newbie

      Hi,

       

      I'm trying to set up Arquillian for our project. We're using Jboss 7.1.0.Alpha2 and Arquillian 1.0.0.CR5. Everything, including the deployment of my package works fine, but when Arquillian tries to connect to JBoss (apparently using JMX), it results in a NPE. First of all, here's the relevant part of my pom.xml:

       

      <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <version>1.0.0.CR5</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.jboss.as</groupId>
      <artifactId>jboss-as-arquillian-container-managed</artifactId>
      <version>7.0.2.Final</version>
      <scope>test</scope>
      </dependency>

       

      This is my arquillian.xml:

       

      <container qualifier="jboss" default="true">
      <protocol type="jmx-as7">
      <property name="executionType">REMOTE</property>
      </protocol>
      <configuration>
      <property name="jbossHome">C:\\dev\\jboss-as-7.1.0.Alpha2-SNAPSHOT</property>
      <property name="serverConfig">target/test-classes/arquillian_standalone.xml</property>
      </configuration>
      </container>

       

      And this is the exception which is being thrown:

       

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

      Test set: com.mycom.MyTest

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

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 12.29 sec <<< FAILURE!

      test(com.mycom.MyTest)  Time elapsed: 0.125 sec  <<< ERROR!

      java.lang.NullPointerException

          at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2327)

          at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:277)

          at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)

          at org.jboss.arquillian.container.spi.client.protocol.metadata.JMXContext.getConnection(JMXContext.java:65)

          at org.jboss.arquillian.protocol.jmx.AbstractJMXProtocol.getExecutor(AbstractJMXProtocol.java:53)

          at org.jboss.arquillian.protocol.jmx.AbstractJMXProtocol.getExecutor(AbstractJMXProtocol.java:35)

          at org.jboss.arquillian.container.test.impl.execution.RemoteTestExecuter.getContainerMethodExecutor(RemoteTestExecuter.java:136)

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

          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.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: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.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: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.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: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.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: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.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: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.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.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)

          at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)

          at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)

          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)

          at $Proxy0.invoke(Unknown Source)

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

          at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)

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

       

      Any idea what might be wrong with out setup, or is this an issue with the AS7 nightly build (7.1.0.Alpha2)?

       

      Cheers,

      Daniel