詳情:如何爲遠程JBoss 7容器配置的Arquillian
- Ant生成(用Maven的擴展,這是在我的公司的解決方案 不能改變)
- 的JBoss 7
- 集裝箱將被獨立啓動
設置:
我有一個測試如下:
@RunWith(Arquillian.class)
public class ArquillianArqTest {
@Deployment @TargetsContainer("jbossas_remote")
public static WebArchive create() {
return ShrinkWrap.create(WebArchive.class);
}
@Test
public void testMyDummy() {
Assert.assertTrue(Boolean.TRUE);
}
}
我有一個arquillian.xml如下:
<protocol type="jmx-as7">
<property name="executionType">REMOTE</property>
</protocol>
<configuration>
<property name="providerUrl">jnp://127.0.0.1:15090</property>
<!--
<property name="managementAddress">TEST</property>
<property name="managementPort">TEST2</property>
-->
</configuration>
</container>
出乎我的意料,如果我嘗試使用屬性managementAddress的Arquillian只會忽略它。就好像我使用providerUrl一樣,它會嘗試連接到定義的主機:端口。 =>這怎麼可能?它不應該嘗試使用JBoss 7的管理地址?
問題:
的arquillian.xml似乎拿起@TargetsContainer也似乎生效。但是當我嘗試運行測試時沒有任何反應。我的意思是部署沒有發生,它只是掛在那裏。我現在不確定我是否使用了正確的管理端口。請參閱的conf /獨立-dev.xml的摘錄:
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<any-address/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="management-native" interface="management" port="15199"/>
<socket-binding name="management-http" interface="management" port="15190"/>
<socket-binding name="management-https" interface="management" port="15143"/>
<socket-binding name="ajp" port="15009"/>
<socket-binding name="http" port="15080"/>
<socket-binding name="https" port="15043"/>
<socket-binding name="jacorb" interface="unsecure" port="15028"/>
<socket-binding name="jacorb-ssl" interface="unsecure" port="15029"/>
<socket-binding name="messaging" port="15045"/>
<socket-binding name="messaging-throughput" port="15055"/>
<socket-binding name="remoting" port="15047"/>
<socket-binding name="txn-recovery-environment" port="15012"/>
<socket-binding name="txn-status-manager" port="15013"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
錯誤:
org.jboss.arquillian.container.spi.client.container.LifecycleException: Could not connect to container ... Caused by: javax.naming.CommunicationException: Could not obtain connection to any of these urls: 127.0.0.1:15090 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server 127.0.0.1:15090 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server
=>我quesion就是從上面列出的那些正確的管理端口?
更新週五1月31日4:10 PM
啊哈,我想端口15199將是正確的。我沒有注意到我得到以下錯誤:
Caused by: javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:15199 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to retrieve stub from server localhost:15199 [Root exception is java.io.StreamCorruptedException: invalid stream header: 0000000C]] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1562) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:634) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627) at javax.naming.InitialContext.lookup(InitialContext.java:392) at org.jboss.arquillian.container.jbossas.remote_6.JBossASRemoteContainer.initDeploymentManager(JBossASRemoteContainer.java:204) at org.jboss.arquillian.container.jbossas.remote_6.JBossASRemoteContainer.start(JBossASRemoteContainer.java:87) ... 61 more Caused by: javax.naming.CommunicationException: Failed to retrieve stub from server localhost:15199 [Root exception is java.io.StreamCorruptedException: invalid stream header: 0000000C] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:268) at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533) ... 66 more Caused by: java.io.StreamCorruptedException: invalid stream header: 0000000C
難道這意味着我可能混合版本的庫嗎?
我會檢查謝謝! – dbalakirev
這是原因!謝謝約翰! – dbalakirev