Question

I'm using Maven and Eclipse to launch container tests. My maven config was setup using the archetype: jboss-javaee6-webapp-ear-blank-archetype

I can launch my Arquillian tests with no problem in JBoss AS7.

But when I try to launch using an embedded Weld EE container I get the following exception:

java.lang.IllegalArgumentException: No org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext found in org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData. Servlet protocol can not be used

What is causing the org.jboss.arquillian.container.spi.client.protocol.metadata.HTTPContext found error and how can I fix it?

I setup two different profiles in my pom, 1 for JBoss AS7 (works) and one for embedded Weld EE (not working):

<profile>
    <id>arq-weld-ee-embedded</id>
          <activation>
              <activeByDefault>true</activeByDefault>
          </activation>
    <dependencies>
        <dependency>
            <groupId>org.jboss.spec</groupId>
            <artifactId>jboss-javaee-6.0</artifactId>
            <version>1.0.0.Final</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.arquillian.container</groupId>
            <artifactId>arquillian-weld-ee-embedded-1.1</artifactId>
            <version>1.0.0.CR3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-core</artifactId>
            <version>1.1.5.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>
</profile>

<profile>
    <!-- An optional Arquillian testing profile that executes tests in your 
        JBoss AS instance -->
    <!-- This profile will start a new JBoss AS instance, and execute the 
        test, shutting it down when done -->
    <!-- Run with: mvn clean test -Parq-jbossas-managed -->
    <id>arq-jbossas-managed</id>
    <dependencies>
        <dependency>
            <groupId>org.jboss.as</groupId>
            <artifactId>jboss-as-arquillian-container-managed</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</profile>

Was it helpful?

Solution

In my arquillian.xml file I had the line:

<defaultProtocol type="Servlet 3.0" />

Upon some research I found out that the embedded Weld EE container does not support the Servlet 3.0 protocol

To fix this problem I removed the defaultProtocol from the config and setup the protocol on a per-container basis.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top