Servlet protocol can not be used
tony.herstell1 Jul 26, 2012 10:24 PMI am trying to get Arquillian going with arquillian-jbossas-managed profile... as that gives this error
>> Missing artifact org.apache.felix:org.apache.felix.resolver:jar:0.1.0.Beta1
when using this setup
<profile> | |||
<id>arquillian-jbossas-managed</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.as</groupId> | |||||
<artifactId>jboss-as-arquillian-container-managed</artifactId> | |||||
<version>7.1.1.Final</version> | |||||
<scope>test</scope> | |||||
</dependency> | |||||
<dependency> | |||||
<groupId>org.jboss.arquillian.protocol</groupId> | |||||
<artifactId>arquillian-protocol-servlet</artifactId> | |||||
<scope>test</scope> | |||||
</dependency> | |||||
</dependencies> | |||||
</profile> | |||||
</profiles> |
Anyhow, it's better to at least have part of arquillian work; so the embedded profile:
<profile> | |||
<id>arquillian-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> |
This setup works for the my existing tests; but alas not when trying to get this test for ModeShape (JCR) going :/
@RunWith(Arquillian.class)
public class RepositoryServiceTest {
@Inject
RepositoryService repositoryService;
@Deployment
public static JavaArchive createDeployment() {
JavaArchive jar = ShrinkWrap.create(JavaArchive.class).addClass(RepositoryService.class).addClass(RepositoryServiceImpl.class)
.addAsResource(new File("src/test/resources/apiary-manager-logo-tall.png")).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
// Add our custom Manifest, which has the additional Dependencies entry
jar.setManifest(new File("src/main/webapp/META-INF/MANIFEST.MF"));
System.out.println(jar.toString(true));
return jar;
}
@Test
public void testDropRepository() {
try {
this.repositoryService.dropRepository();
} catch (RepositoryException e) {
Assert.fail();
}
}
Poking about in the ModeShape arquillian testing area (setup for JBoss 7) I see they have full setup for the arquillian.xml file which includes the schema localtion (possbly missing from the "getting started" doco):
<?xml version="1.0" encoding="UTF-8"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<!-- Force the use of the Servlet 3.0 protocol with all containers, as it
is the most mature -->
<defaultProtocol type="Servlet 3.0"/>
<!-- Uncomment to have test archives exported to the file system for inspection -->
<!-- <engine> -->
<!-- <property name="deploymentExportPath">target/</property> -->
<!-- </engine> -->
<!-- <container qualifier="jboss7" default="true"> -->
<!-- <configuration> -->
<!-- <property name="jbossHome">${project.build.directory}/jboss-as-${jbossas-version}</property> -->
<!-- <property name="serverConfig">standalone-modeshape.xml</property> -->
<!-- <property name="javaVmArguments">-Xmx512m -XX:MaxPermSize=128m -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=${arquillian.suspend}</property> -->
<!-- </configuration> -->
<!-- </container> -->
</arquillian>
anyhow; when I use the <defaultProtocol type="Servlet 3.0"/>
I get this:
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
at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:64)
at org.jboss.arquillian.protocol.servlet.BaseServletProtocol.getExecutor(BaseServletProtocol.java:35)
I added this:
<dependency> | ||
<groupId>org.jboss.arquillian.protocol</groupId> | ||
<artifactId>arquillian-protocol-servlet</artifactId> | ||
<scope>test</scope> | ||
</dependency> |
which was mentioned in another post of yours... to no avail.
It's a pretty stock pom.xml file (attached - no sublevels) apart from the bit from pl.com.it-crowd.mock-contexts-extension to try to get Converstions (part of J6EE spec) working as arquillian does not support converstions it seems (I have not managed to get this working yet either).
-
pom.xml 10.6 KB