title: Arquillian: Can not run tests from IDE
body: <p>My test looks like  </p>
  
  <pre><code>@RunWith(Arquillian.class)
  public class TweetStreamTest {
  
      @ArquillianResource
      URI uri;
  
      @Deployment(testable = false)
      public static WebArchive createDeployment() {
          return ShrinkWrap.create(WebArchive.class).addClasses(TweetStreamServer.class, TweetStreamClient.class);
      }
  
      @RunAsClient
      @Test
      public void test() throws URISyntaxException {
          System.out.println("URI: " + getEndpointUrl());
          assertTrue(true);
      }
  
      private URI getEndpointUrl() throws URISyntaxException {
          return new URI("ws://" + uri.getHost() +
                  ":" + uri.getPort() + uri.getPath());
      }
  }
  </code></pre>
  
  <p>My maven dependencies look like  </p>
  
  <pre><code>&lt;properties&gt;
      &lt;org.wildfly&gt;8.0.0.Final&lt;/org.wildfly&gt;
      &lt;maven.test.skip&gt;false&lt;/maven.test.skip&gt;
  &lt;/properties&gt;
  &lt;dependencyManagement&gt;
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.arquillian&lt;/groupId&gt;
              &lt;artifactId&gt;arquillian-bom&lt;/artifactId&gt;
              &lt;version&gt;1.1.5.Final&lt;/version&gt;
              &lt;scope&gt;import&lt;/scope&gt;
              &lt;type&gt;pom&lt;/type&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/dependencyManagement&gt;
  
  &lt;groupId&gt;com.self&lt;/groupId&gt;
  &lt;artifactId&gt;tweetstream&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
  &lt;build&gt;
      &lt;defaultGoal&gt;clean install&lt;/defaultGoal&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.1&lt;/version&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
          &lt;version&gt;7.0&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;version&gt;4.11&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Add Arquillian --&gt;
      &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;!-- Add Container Adapter --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.wildfly&lt;/groupId&gt;
          &lt;artifactId&gt;wildfly-arquillian-container-managed&lt;/artifactId&gt;
          &lt;version&gt;8.0.0.Final&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;!--&lt;dependency&gt;
          &lt;groupId&gt;org.jboss.weld&lt;/groupId&gt;
          &lt;artifactId&gt;weld-core&lt;/artifactId&gt;
          &lt;version&gt;1.1.5.Final&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-simple&lt;/artifactId&gt;
          &lt;version&gt;1.6.4&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;wildfly-managed-arquillian&lt;/id&gt;
          &lt;properties&gt;
              &lt;browser&gt;chromium-browser&lt;/browser&gt;
              &lt;serverProfile&gt;standalone-full.xml&lt;/serverProfile&gt;
              &lt;serverRoot&gt;${project.build.directory}/wildfly-${org.wildfly}&lt;/serverRoot&gt;
          &lt;/properties&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;io.undertow&lt;/groupId&gt;
                  &lt;artifactId&gt;undertow-websockets-jsr&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0.Beta25&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
                  &lt;artifactId&gt;resteasy-client&lt;/artifactId&gt;
                  &lt;version&gt;3.0.5.Final&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
                  &lt;artifactId&gt;resteasy-jaxb-provider&lt;/artifactId&gt;
                  &lt;version&gt;3.0.5.Final&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.jboss.resteasy&lt;/groupId&gt;
                  &lt;artifactId&gt;resteasy-json-p-provider&lt;/artifactId&gt;
                  &lt;version&gt;3.0.5.Final&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.wildfly&lt;/groupId&gt;
                  &lt;artifactId&gt;wildfly-arquillian-container-managed&lt;/artifactId&gt;
                  &lt;version&gt;${org.wildfly}&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
          &lt;build&gt;
              &lt;testResources&gt;
                  &lt;testResource&gt;
                      &lt;directory&gt;src/test/resources&lt;/directory&gt;
                      &lt;filtering&gt;true&lt;/filtering&gt;
                  &lt;/testResource&gt;
                  &lt;testResource&gt;
                      &lt;directory&gt;src/test/resources-wildfly-managed&lt;/directory&gt;
                      &lt;filtering&gt;true&lt;/filtering&gt;
                  &lt;/testResource&gt;
              &lt;/testResources&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;skip&gt;${maven.test.skip}&lt;/skip&gt;
                      &lt;/configuration&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;id&gt;unpack&lt;/id&gt;
                              &lt;phase&gt;process-test-classes&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;unpack&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;configuration&gt;
                                  &lt;artifactItems&gt;
                                      &lt;artifactItem&gt;
                                          &lt;groupId&gt;org.wildfly&lt;/groupId&gt;
                                          &lt;artifactId&gt;wildfly-dist&lt;/artifactId&gt;
                                          &lt;version&gt;${org.wildfly}&lt;/version&gt;
                                          &lt;type&gt;zip&lt;/type&gt;
                                          &lt;overWrite&gt;false&lt;/overWrite&gt;
                                          &lt;outputDirectory&gt;${project.build.directory}&lt;/outputDirectory&gt;
                                      &lt;/artifactItem&gt;
                                  &lt;/artifactItems&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;environmentVariables&gt;
                              &lt;JBOSS_HOME&gt;${project.build.directory}/wildfly-${org.wildfly}&lt;/JBOSS_HOME&gt;
                          &lt;/environmentVariables&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>This runs fins on command line when I run it as  <code>mvn -Pwildfly-managed-arquillian</code>. When I run it through IDE (I use IntelliJ IDEA), I get error as  </p>
  
  <pre><code>org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not start container
      at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:208)
      at org.jboss.as.arquillian.container.CommonDeployableContainer.start(CommonDeployableContainer.java:112)
      at org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:199)
      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:163)
      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:157)
      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:255)
      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startContainer(ContainerLifecycleController.java:156)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      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.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
      at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:77)
      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:70)
      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forEachSuiteContainer(ContainerLifecycleController.java:221)
      at org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startSuiteContainers(ContainerLifecycleController.java:69)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      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:145)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
      at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
      at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:86)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      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.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
      at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeSuite(EventTestRunnerAdaptor.java:68)
      at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:104)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
  Caused by: java.lang.NullPointerException
      at java.io.File.&lt;init&gt;(File.java:277)
      at org.jboss.as.arquillian.container.managed.ManagedDeployableContainer.startInternal(ManagedDeployableContainer.java:94)
      ... 65 more
  </code></pre>
  
  <p><strong>Question</strong><br>
  When do I need to do in order to run this test from IDEA?</p>
  
  <p>I am pretty sure I am missing something very basic, but do not know why</p>