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

    Please include at least 1 Deployable Container on your Classpath  ?

    daxxy

      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>

        • 1. Re: Please include at least 1 Deployable Container on your Classpath  ?
          daxxy

          This "fixed itself".  I think it's a version problem perhaps?  Since I use eclipse it is very easy to get the latest version of any artifact if you use the pom editor to add dependencies.  Once I stopped using that and simply cut/pasted directly from the tutorial, this issue went away.


          At this point I've done a lot of reading and I think this error means there was no container on the classpath. Not sure why that happened since it is declared as a dependency in the pom.

           

          Is anyone reading this forum who responds to newbie questions?

           

          TDR

          1 of 1 people found this helpful
          • 2. Re: Please include at least 1 Deployable Container on your Classpath  ?
            bmajsak

            Of course there is always someone I would recommend you to have a look at another guide with forge. You will have less maven headaches if you use the plugin. Are you still facing this problem with Weld Embedded?

            1 of 1 people found this helpful
            • 3. Re: Please include at least 1 Deployable Container on your Classpath  ?
              daxxy

              Hi Bartosz! Thanks for your reply.  These problems have been resolved, but again, it's a bit of a mystery why.  It's one of those things where I was tinkering and tinkering and restarting and restarting and at some point it Just Worked.