1 Reply Latest reply on Feb 11, 2015 8:34 AM by aslak

    Arquillian could not find dependency to inject.

    mihai238

      Hi,

       

      I'm trying to get arquillian working on my project.

      The error "Unsatisfied dependencies for type MessageHandler with qualifiers @Default" is telling me, that Arquillian is not able to find an injected dependency. Even though I have added the respective classes using addClasses().

       

      Part of my pom.xml:

       

      [code]

      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
        <execution>
        <id>unpack</id>
        <phase>process-test-classes</phase>
        <goals>
        <goal>unpack</goal>
        </goals>
        <configuration>
        <artifactItems>
        <artifactItem>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-dist</artifactId>
        <version>8.1.0.Final</version>
        <type>zip</type>
        <overWrite>false</overWrite>
        <outputDirectory>target</outputDirectory>
        </artifactItem>
        </artifactItems>
        </configuration>
        </execution>
        </executions>
      </plugin>

      ...

      <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-arquillian-container-managed</artifactId>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-embedded</artifactId>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian.extension</groupId>
        <artifactId>arquillian-transaction-jta</artifactId>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.jboss.shrinkwrap.resolver</groupId>
        <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
        <version>${shrinkwrap-resolver-impl-maven.version}</version>
        <scope>test</scope>
      </dependency>

      [/code]

       

      @ArquillianSuiteDeployment
      public class Deployments {
           @Deployment
           public static EnterpriseArchive archive() {
                ...
                .addClasses(MessageHandler.class)
      
                ...
      
           }
      }
      

       

      Could anyone give me a hint?

       

      Thank you,

      Mihai