title: Arquillian:Could not setup GlassFish Embedded Runtime
body: <p>I try to make a test with Arquillian in a maven project however in every execution of the test that gives me the following exception:</p>
  
  <pre><code>Grave: Exception in command execution : java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
  Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.855 sec &lt;&lt;&lt; FAILURE!
  Tests in error: 
  es.costa.service.test.magali.PersonaFactorTest: Could not setup GlassFish Embedded Runtime
  Caused by: org.glassfish.embeddable.GlassFishException: PlainTextActionReporterFAILUREjava.lang.NoClassDefFoundError: javax/validation/ParameterNameProviderjava.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
  java.lang.RuntimeException: Could not setup GlassFish Embedded Runtime
  </code></pre>
  
  <p><strong><em>This is the pom.xml:</em></strong></p>
  
  <pre><code>&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.0.3.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;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.jboss.ejb3&lt;/groupId&gt;
          &lt;artifactId&gt;jboss-ejb3-ext-api&lt;/artifactId&gt;
          &lt;version&gt;2.1.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;es.costa&lt;/groupId&gt;
          &lt;artifactId&gt;costa-interfaces&lt;/artifactId&gt;
          &lt;version&gt;${project.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&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;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
          &lt;version&gt;5.1.3.Final&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-validator-annotation-processor&lt;/artifactId&gt;
          &lt;version&gt;5.0.3.Final&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;build&gt;
      &lt;sourceDirectory&gt;ejbModule/src/main/java&lt;/sourceDirectory&gt;
      &lt;testSourceDirectory&gt;ejbModule/src/test/java&lt;/testSourceDirectory&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;ejbModule/src/main/resources&lt;/directory&gt;
              &lt;excludes&gt;
                  &lt;exclude&gt;**/*.java&lt;/exclude&gt;
              &lt;/excludes&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;testResources&gt;
          &lt;testResource&gt;
              &lt;directory&gt;ejbModule/src/test/resources&lt;/directory&gt;
          &lt;/testResource&gt;
      &lt;/testResources&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;${maven-compiler-plugin.version}&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.7&lt;/source&gt;
                  &lt;target&gt;1.7&lt;/target&gt;
                  &lt;encoding&gt;Cp1252&lt;/encoding&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.12&lt;/version&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-ejb-plugin&lt;/artifactId&gt;
              &lt;version&gt;${maven-ejb-plugin.version}&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;ejbVersion&gt;${ejb.version}&lt;/ejbVersion&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;shade&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;artifactSet&gt;
                      &lt;includes&gt;
                          &lt;include&gt;es.costa&lt;/include&gt;
                      &lt;/includes&gt;
                  &lt;/artifactSet&gt;
                  &lt;finalName&gt;${artifactId}-${project.version}&lt;/finalName&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.jboss.as.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-as-maven-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;filename&gt;${artifactId}-${project.version}.jar&lt;/filename&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;dev&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
                  &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;javax.persistence&lt;/groupId&gt;
                  &lt;artifactId&gt;persistence-api&lt;/artifactId&gt;
                  &lt;version&gt;${javax-persistance.version}&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;jenkins&lt;/id&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
                  &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;javax.persistence&lt;/groupId&gt;
                  &lt;artifactId&gt;persistence-api&lt;/artifactId&gt;
                  &lt;version&gt;${javax-persistance.version}&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;arquillian-glassfish-embedded&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.jboss.arquillian.container&lt;/groupId&gt;
                  &lt;artifactId&gt;arquillian-glassfish-embedded-3.1&lt;/artifactId&gt;
                  &lt;version&gt;1.0.0.CR3&lt;/version&gt;
                  &lt;scope&gt;test&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.glassfish.main.extras&lt;/groupId&gt;
                  &lt;artifactId&gt;glassfish-embedded-all&lt;/artifactId&gt;
                  &lt;version&gt;3.1.2&lt;/version&gt;
                  &lt;scope&gt;provided&lt;/scope&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.h2database&lt;/groupId&gt;
                  &lt;artifactId&gt;h2&lt;/artifactId&gt;
                  &lt;version&gt;1.3.166&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;ejbModule/src/test/resources&lt;/directory&gt;
                  &lt;/testResource&gt;
                  &lt;testResource&gt;
                      &lt;directory&gt;ejbModule/src/test/resources-glassfish-embedded&lt;/directory&gt;
                  &lt;/testResource&gt;
              &lt;/testResources&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.12&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;systemPropertyVariables&gt;
                             &lt;arquillian.launch&gt;glassfish-embedded&lt;/arquillian.launch&gt;
                              &lt;java.util.logging.config.file&gt;
                                  ${project.build.testOutputDirectory}/logging.properties
                              &lt;/java.util.logging.config.file&gt;
                              &lt;derby.stream.error.file&gt;
                                  ${project.build.directory}/derby.log
                              &lt;/derby.stream.error.file&gt;
                          &lt;/systemPropertyVariables&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p><strong><em>this is the arquillian.xml</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;arquillian xmlns="http://jboss.org/schema/arquillian"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
      http://jboss.org/schema/arquillian
      http://jboss.org/schema/arquillian/arquillian_1_0.xsd"&gt;
  
  &lt;container qualifier="glassfish-embedded" default="true"&gt;
      &lt;configuration&gt;
          &lt;property name="resourcesXml"&gt;
              ejbModule/src/test/resources-glassfish-embedded/glassfish-resources.xml
          &lt;/property&gt;
      &lt;/configuration&gt;
  &lt;/container&gt;    
  </code></pre>
  
  <p></p>
  
  <p><strong><em>This is glassfish-resources.xml</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE resources PUBLIC
  "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN"
  "http://glassfish.org/dtds/glassfish-resources_1_5.dtd"&gt;
  &lt;resources&gt;
  &lt;jdbc-resource pool-name="ArquillianEmbeddedH2Pool"
      jndi-name="jdbc/arquillian"/&gt;
  &lt;jdbc-connection-pool name="ArquillianEmbeddedH2Pool"
      res-type="javax.sql.DataSource"
      datasource-classname="org.h2.jdbcx.JdbcDataSource"&gt;
      &lt;property name="user" value="sa"/&gt;
      &lt;property name="password" value=""/&gt;
      &lt;property name="url" value="jdbc:h2:file:target/databases/h2/db"/&gt;
  &lt;/jdbc-connection-pool&gt;    
  </code></pre>
  
  <p></p>