title: Arquillian - ClassNotFound on org.jboss.arquillian.core.api.threading.ExecutorService
body: <p>I'm currently trying to make arquillian works but I have a problem on one of my Unit Test. It fails on a CLassNotFoundException on class <code>org.jboss.arquillian.core.api.threading.ExecutorService</code>. Maybe I forgot a dependancy in my pom.xml, or I misunderstood something but I cannot solve this issue. </p>
  
  <p>Here is the stacktrace : </p>
  
  <pre><code>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:95)
      at org.junit.runners.Suite.runChild(Suite.java:127)
      at org.junit.runners.Suite.runChild(Suite.java:26)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.junit.runners.Suite.runChild(Suite.java:127)
      at org.junit.runners.Suite.runChild(Suite.java:26)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.junit.runners.Suite.runChild(Suite.java:127)
      at org.junit.runners.Suite.runChild(Suite.java:26)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      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:202)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
  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:526)
      at org.jboss.arquillian.test.spi.SecurityActions.newInstance(SecurityActions.java:156)
      ... 37 more
  Caused by: java.lang.RuntimeException: Could not create new instance of class org.jboss.arquillian.core.impl.ManagerImpl
      at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:160)
      at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:111)
      at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:97)
      at org.jboss.arquillian.core.spi.ManagerBuilder.create(ManagerBuilder.java:77)
      at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.&lt;init&gt;(EventTestRunnerAdaptor.java:55)
      ... 42 more
  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:526)
      at org.jboss.arquillian.core.spi.SecurityActions.newInstance(SecurityActions.java:156)
      ... 46 more
  Caused by: java.lang.NoClassDefFoundError: org/jboss/arquillian/core/api/threading/ExecutorService
      at org.jboss.arquillian.core.impl.ManagerImpl$3.call(ManagerImpl.java:470)
      at org.jboss.arquillian.core.impl.ManagerImpl.executeInApplicationContext(ManagerImpl.java:242)
      at org.jboss.arquillian.core.impl.ManagerImpl.createBuiltInServices(ManagerImpl.java:465)
      at org.jboss.arquillian.core.impl.ManagerImpl.&lt;init&gt;(ManagerImpl.java:94)
      ... 51 more
  Caused by: java.lang.ClassNotFoundException: org.jboss.arquillian.core.api.threading.ExecutorService
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      ... 55 more
  </code></pre>
  
  <p>Here are the files :</p>
  
  <p><code>pom.xml</code></p>
  
  <pre><code>&lt;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"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;be.normegil&lt;/groupId&gt;
      &lt;artifactId&gt;librarium&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;librarium&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.7.7&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-simple&lt;/artifactId&gt;
              &lt;version&gt;1.7.7&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- Apache Commons --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
              &lt;artifactId&gt;commons-lang3&lt;/artifactId&gt;
              &lt;version&gt;3.3.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- JEE 7 - API --&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;!-- JEE 7 - JPA --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
              &lt;version&gt;4.3.4.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- TEST DEPENDANCIES --&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;dependency&gt;
              &lt;groupId&gt;org.mockito&lt;/groupId&gt;
              &lt;artifactId&gt;mockito-all&lt;/artifactId&gt;
              &lt;version&gt;1.9.5&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.jboss.arquillian.junit&lt;/groupId&gt;
              &lt;artifactId&gt;arquillian-junit-container&lt;/artifactId&gt;
              &lt;version&gt;1.1.4.Final&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;!-- REST Testing framework --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.jayway.restassured&lt;/groupId&gt;
              &lt;artifactId&gt;rest-assured&lt;/artifactId&gt;
              &lt;version&gt;2.3.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hsqldb&lt;/groupId&gt;
              &lt;artifactId&gt;hsqldb&lt;/artifactId&gt;
              &lt;version&gt;2.3.2&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-embedded&lt;/artifactId&gt;
              &lt;version&gt;8.1.0.CR1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;!-- Used by persistence.xml in test resources --&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;/testResources&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p><code>GameREST.java</code></p>
  
  <pre><code>package be.normegil.librarium.rest;
  
  import be.normegil.librarium.model.dao.GameDAO;
  import be.normegil.librarium.model.data.Game;
  import org.apache.commons.lang3.Validate;
  
  import javax.inject.Inject;
  import javax.ws.rs.*;
  import java.util.Collection;
  
  @Path("/games")
  public class GameREST {
  
      private GameDAO gameDAO;
  
      @GET
      @Path("/all")
      @Produces("application/json")
      public Collection&lt;Game&gt; getGamesList() {
          return gameDAO.getAll();
      }
  
      @GET
      @Path("{ID}")
      @Produces("application/json")
      public Game getGame(@PathParam("ID") Long id) {
          Validate.notNull(id);
  
          return gameDAO.get(id);
      }
  
      @PUT
      @Path("{Name}")
      @Produces("application/json")
      public void createGame(@PathParam("Name") String name) {
          Validate.notNull(name);
  
          Game game = new Game(name);
          gameDAO.save(game);
      }
  
      @POST
      @Path("{ID}/{Name}")
      public void updateGame(@PathParam("ID") Long id,
                             @PathParam("Name") String name) {
          Validate.notNull(id);
          Validate.notNull(name);
          Game game = gameDAO.get(id);
          if(game == null){
              throw new IllegalArgumentException("No game found for ID : " + id);
          }
  
          game.setName(name);
          gameDAO.save(game);
      }
  
      @DELETE
      @Path("{ID}")
      public void deleteGame(@PathParam("ID") Long id) {
          Validate.notNull(id);
          Game game = gameDAO.get(id);
          if(game == null){
              throw new IllegalArgumentException("No game found for ID : " + id);
          }
  
          gameDAO.remove(game);
      }
  
      @Inject
      public void setGameDAO(final GameDAO gameDAO) {
          this.gameDAO = gameDAO;
      }
  }
  </code></pre>
  
  <p><code>GameRESTTestREST.java</code></p>
  
  <pre><code>package be.normegil.librarium.rest;
  
  import be.normegil.librarium.LibrariumApplication;
  import org.apache.http.HttpStatus;
  import org.jboss.arquillian.container.test.api.Deployment;
  import org.jboss.arquillian.container.test.api.RunAsClient;
  import org.jboss.arquillian.junit.Arquillian;
  import org.jboss.shrinkwrap.api.ShrinkWrap;
  import org.jboss.shrinkwrap.api.spec.WebArchive;
  import org.junit.Test;
  import org.junit.runner.RunWith;
  
  import static com.jayway.restassured.RestAssured.expect;
  
  @RunWith(Arquillian.class)
  public class GameRESTTestREST {
  
      @Deployment
      public static WebArchive createTestArchive() {
          return ShrinkWrap.create(WebArchive.class)
                  .addClass(GameREST.class)
                  .addClass(LibrariumApplication.class);
      }
  
      @Test
      @RunAsClient
      public void testGetAll() throws Exception {
          expect()
                  .statusCode(HttpStatus.SC_OK)
                  .log().ifError()
                  .when()
                  .get("/games/all");
      }
  }
  </code></pre>
  
  <p>Why do I have a <code>ClassNotFoundException</code> on <code>org.jboss.arquillian.core.api.threading.ExecutorService</code> ? Any idea where the problem is ?</p>