3 Replies Latest reply on Jul 9, 2013 8:46 AM by Tanya Ruttenberg

    Please include at least 1 Deployable Container on your Classpath  ?

    Tanya Ruttenberg Expert

      Brand new to Arquillian.  Following the Getting Started guide, first part, but getting this error when I run it from eclipse OR from commandline.  Can someone please explain why and how to fix it?

       

       

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

      Test set: gov.ssa.dne.nmst.GreeterTest

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

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

      gov.ssa.dne.nmst.GreeterTest Time elapsed: 0.56 sec <<< ERROR!

      org.jboss.arquillian.container.test.impl.client.deployment.ValidationException: DeploymentScenario contains a target (_DEFAULT_) not matching any defined Container in the registry.

      Please include at least 1 Deployable Container on your Classpath.

      at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.throwNoContainerFound(DeploymentGenerator.java:250)

      at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.throwTargetNotFoundValidationException(DeploymentGenerator.java:243)

      at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.validate(DeploymentGenerator.java:102)

      at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:84)

      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: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:135)

      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

      at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

      at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)

      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: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.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:94)

      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:94)

      at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

      at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

      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.JUnit4Provider.execute(JUnit4Provider.java:236)

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

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

      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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)

      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)

      at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)

      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)

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

       

      GreeterTest.java

       

      import javax.inject.Inject;

      import org.jboss.arquillian.container.test.api.Deployment;
      import org.jboss.arquillian.junit.Arquillian;
      import org.jboss.shrinkwrap.api.ShrinkWrap;
      import org.jboss.shrinkwrap.api.asset.EmptyAsset;
      import org.jboss.shrinkwrap.api.spec.JavaArchive;
      import org.junit.Assert;
      import org.junit.Test;
      import org.junit.runner.RunWith;

      @RunWith(Arquillian.class)
      public class GreeterTest {

      @Deployment
      public static JavaArchive createDeployment() {
        return ShrinkWrap.create(JavaArchive.class).addClass(Greeter.class)
          .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
      }

      @Inject
      Greeter greeter;

      @Test
      public void should_create_greeting() {
        Assert.assertEquals("Hello, Earthling!",
          greeter.createGreeting("Earthling"));
        greeter.greet(System.out, "Earthling");

      }
      }

       

      pom.xml

       

      <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">
      <modelVersion>4.0.0</modelVersion>

      <groupId>gov.ssa.dne.nmst</groupId>
      <artifactId>arquillian-tutorial</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>jar</packaging>

      <name>arquillian-tutorial</name>
      <url>http://maven.apache.org</url>

      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>


      <dependencyManagement>
        <dependencies>
         <dependency>
          <groupId>org.jboss.arquillian</groupId>
          <artifactId>arquillian-bom</artifactId>
          <version>1.0.3.Final</version>
          <type>pom</type>
          <scope>import</scope>
         </dependency>
         <dependency>
          <groupId>org.jboss.spec</groupId>
          <artifactId>jboss-javaee-6.0</artifactId>
          <version>3.0.2.Final</version>
          <type>pom</type>
          <scope>import</scope>
         </dependency>
        </dependencies>
      </dependencyManagement>

      <dependencies>
        <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>4.8.1</version>
         <scope>test</scope>
        </dependency>

        <dependency>
         <groupId>org.jboss.arquillian.junit</groupId>
         <artifactId>arquillian-junit-container</artifactId>
         <scope>test</scope>
        </dependency>

        <dependency>
         <groupId>org.jboss.weld.arquillian.container</groupId>
         <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
         <version>1.1.0.Final</version>
         <scope>test</scope>
        </dependency>
        <dependency>
         <groupId>org.jboss.weld</groupId>
         <artifactId>weld-core</artifactId>
         <version>1.1.8.Final</version>
         <scope>test</scope>
        </dependency>
        <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-simple</artifactId>
         <version>1.6.4</version>
         <scope>test</scope>
        </dependency>
      </dependencies>

       

      <build>
        <finalName>arquillian-tutorial</finalName>
        <plugins>
         <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.3.2</version>
          <configuration>
           <source>1.6</source>
           <target>1.6</target>
          </configuration>
         </plugin>
         <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.12</version>
         </plugin>
        </plugins>
      </build>

      </project>