2013-07-24 81 views
2

我正在使用Maven和Eclipse來啓動容器測試。我的maven配置是使用原型設置的:jboss-javaee6-webapp-ear-blank-archetype當在嵌入式Weld EE容器中啓動時發現Arquillian沒有HTTPContext

我可以在JBoss AS7中啓動我的Arquillian測試,沒有問題。

但是當我嘗試使用嵌入焊接EE容器我得到下面的異常推出:

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 

是什麼原因造成的org.jboss.arquillian.container.spi.client.protocol.metadata。 HTTPContext發現錯誤,我該如何解決它?

我設置兩個不同的配置文件在我的POM,1 JBoss的AS7(工程)和一個嵌入式焊縫EE(不工作):

<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> 

回答

3

在我的Arquillian .xml文件我有行:

<defaultProtocol type="Servlet 3.0" /> 

經過一些研究,我發現o那the embedded Weld EE container does not support the Servlet 3.0 protocol

要解決這個問題,我從配置中刪除了defaultProtocol,並在每個容器的基礎上設置協議。

+0

我已經爲每個容器設置了具有主機和端口屬性的。我仍然面臨同樣的問題。 我使用的是arquillian 1.1.13.Final&2.1.0.Beta1 org.wildfly.arquillian。 – Saurabhcdt

+0

我按照這裏的說明https://docs.jboss.org/author/display/ARQ/Container+configuration解決了問題 –

相關問題