title: Arquillian test execution fails with JBoss 7.1 and vanilla Jboss kitchensink example
body: <p>Following the README instructions of the <a href="https://docs.jboss.org/author/display/AS7/Kitchensink+quickstart" rel="nofollow noreferrer">jboss-as-kitchensink example</a>, I have tried to run the arquillian tests as advertised, with following results:</p>
  
  <p>when running  <code>mvn clean test -Parq-jbossas-remote</code>, I get these exceptions (copied from the surefire reports). Sorry for the long listing, I think the <code>java.net.ConnectException: Connection refused</code> exception near the bottom of the listing is the most relevant event but I'm not sure:</p>
  
  <pre><code>&lt;error message="Could not deploy to container" type="org.jboss.arquillian.container.spi.client.container.DeploymentException"&gt;org.jboss.arquillian.container.spi.client.container.DeploymentException: Could not deploy to container
      at org.jboss.as.arquillian.container.ArchiveDeployer.deploy(ArchiveDeployer.java:68)
      at org.jboss.as.arquillian.container.CommonDeployableContainer.deploy(CommonDeployableContainer.java:142)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:156)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:123)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:266)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:122)
      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.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)
      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.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.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.proceed(EventContextImpl.java:88)
      at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)
      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.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
      at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:90)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:79)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:258)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:234)
      at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:78)
      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.client.ContainerEventController.execute(ContainerEventController.java:101)
      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.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
      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:60)
      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.core.impl.ManagerImpl.fire(ManagerImpl.java:114)
      at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
      at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)
      at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
      at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
      at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
      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)
      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.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
      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.RuntimeException: java.net.ConnectException: JBAS012174: Could not connect to remote://localhost:9999. The connection failed
      at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:113)
      at org.jboss.as.controller.client.helpers.standalone.impl.ModelControllerClientServerDeploymentManager.executeOperation(ModelControllerClientServerDeploymentManager.java:47)
      at org.jboss.as.controller.client.helpers.standalone.impl.AbstractServerDeploymentManager.execute(AbstractServerDeploymentManager.java:79)
      at org.jboss.as.arquillian.container.ArchiveDeployer.executeDeploymentPlan(ArchiveDeployer.java:84)
      at org.jboss.as.arquillian.container.ArchiveDeployer.deploy(ArchiveDeployer.java:58)
      ... 94 more
  Caused by: java.net.ConnectException: JBAS012174: Could not connect to remote://localhost:9999. The connection failed
      at org.jboss.as.protocol.ProtocolChannelClient.connectSync(ProtocolChannelClient.java:164)
      at org.jboss.as.protocol.mgmt.ManagementClientChannelStrategy$Establishing.getChannel(ManagementClientChannelStrategy.java:166)
      at org.jboss.as.controller.client.impl.RemotingModelControllerClient.getOrCreateChannel(RemotingModelControllerClient.java:138)
      at org.jboss.as.controller.client.impl.RemotingModelControllerClient$1.getChannel(RemotingModelControllerClient.java:62)
      at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:106)
      at org.jboss.as.protocol.mgmt.ManagementChannelHandler.executeRequest(ManagementChannelHandler.java:89)
      at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeRequest(AbstractModelControllerClient.java:252)
      at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:151)
      at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeAsync(AbstractModelControllerClient.java:111)
      ... 98 more
  Caused by: java.net.ConnectException: Connection refused
      at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
      at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:701)
      at org.xnio.nio.NioXnioWorker$1.handleEvent(NioXnioWorker.java:322)
      at org.xnio.nio.NioXnioWorker$1.handleEvent(NioXnioWorker.java:318)
      at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
      at org.xnio.nio.NioHandle.run(NioHandle.java:90)
      at org.xnio.nio.WorkerThread.run(WorkerThread.java:184)
      at ...asynchronous invocation...(Unknown Source)
      at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:268)
      at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:250)
      at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:359)
      at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:347)
      at org.jboss.as.protocol.ProtocolChannelClient.connect(ProtocolChannelClient.java:125)
      at org.jboss.as.protocol.ProtocolChannelClient.connectSync(ProtocolChannelClient.java:134)
      ... 106 more
  </code></pre>
  
  <p>Have found nothing useful on that by googling or on the jboss forums. <a href="https://stackoverflow.com/questions/7341308/cannot-run-arquillian-tests">this thread</a> does not help.</p>
  
  <p>My Jboss is running, I have the management-native port set to 9999 (the default), double-checked the <code>jbossHome</code> property in the arquillian.xml</p>
  
  <p>When running <code>mvn clean test -Parq-jbossas-managed</code>, the server starts up, deploys the application and then nothing happens...</p>
  
  <p>What could be the source of the problems and what can be done? Any additional info I could provide?<br>
  Thank you</p>
  
  <p><strong>EDIT</strong>
  Here are the relavant sections of the <code>pom</code>. Note - this is the unchanged pom from the kitchensink example. I have changed nothing.</p>
  
  <p>dependency management:</p>
  
  <pre><code>        &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.bom&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-javaee-6.0-with-tools&lt;/artifactId&gt;
              &lt;version&gt;${javaee6.with.tools.version}&lt;/version&gt;
              &lt;type&gt;pom&lt;/type&gt;
              &lt;scope&gt;import&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  </code></pre>
  
  <p>arquilllian dependencies : </p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.arquillian.junit&lt;/groupId&gt;
          &lt;artifactId&gt;arquillian-junit-container&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.arquillian.protocol&lt;/groupId&gt;
          &lt;artifactId&gt;arquillian-protocol-servlet&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>the arquilllian remote profile (the managed profile is almost identical):</p>
  
  <pre><code>    &lt;profile&gt;
          &lt;!-- We add the JBoss repository as we need the JBoss AS connectors for
              Arquillian --&gt;
          &lt;repositories&gt;
              &lt;!-- The JBoss Community public repository is a composite repository
                  of several major repositories --&gt;
              &lt;!-- see http://community.jboss.org/wiki/MavenGettingStarted-Users --&gt;
              &lt;repository&gt;
                  &lt;id&gt;jboss-public-repository&lt;/id&gt;
                  &lt;name&gt;JBoss Repository&lt;/name&gt;
                  &lt;url&gt;http://repository.jboss.org/nexus/content/groups/public&lt;/url&gt;
                  &lt;!-- These optional flags are designed to speed up your builds by reducing
                      remote server calls --&gt;
                  &lt;releases&gt;
                  &lt;/releases&gt;
                  &lt;snapshots&gt;
                      &lt;enabled&gt;false&lt;/enabled&gt;
                  &lt;/snapshots&gt;
              &lt;/repository&gt;
          &lt;/repositories&gt;
  
          &lt;pluginRepositories&gt;
              &lt;pluginRepository&gt;
                  &lt;id&gt;jboss-public-repository&lt;/id&gt;
                  &lt;name&gt;JBoss Repository&lt;/name&gt;
                  &lt;url&gt;http://repository.jboss.org/nexus/content/groups/public&lt;/url&gt;
                  &lt;releases&gt;
                  &lt;/releases&gt;
                  &lt;snapshots&gt;
                      &lt;enabled&gt;false&lt;/enabled&gt;
                  &lt;/snapshots&gt;
              &lt;/pluginRepository&gt;
          &lt;/pluginRepositories&gt;
  
          &lt;!-- An optional Arquillian testing profile that executes tests in a remote
              JBoss AS instance --&gt;
          &lt;!-- Run with: mvn clean test -Parq-jbossas-remote --&gt;
          &lt;id&gt;arq-jbossas-remote&lt;/id&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.jboss.as&lt;/groupId&gt;
                  &lt;artifactId&gt;jboss-as-arquillian-container-remote&lt;/artifactId&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/profile&gt;
  </code></pre>