gpt4 book ai didi

java - 如何为远程 JBoss 7 容器配置 arquillian

转载 作者:行者123 更新时间:2023-12-01 23:14:08 25 4
gpt4 key购买 nike

详细信息:

  • Ant Build(带有 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>

令我惊讶的是,如果我尝试使用属性管理地址,arquillian 会简单地忽略它。就好像我使用providerUrl一样,它会尝试连接到定义的主机:端口。=> 这怎么可能?难道不应该尝试使用 JBoss 7 的 managementAddress 吗?

问题:

arquillian.xml 似乎已生效,@TargetsContainer 似乎也已生效。但是当我尝试运行测试时什么也没有发生。我的意思是部署没有发生,只是卡在那里。我现在不确定是否使用了正确的管理端口。请参阅conf/standalone-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

=> 我的问题是上面列出的正确管理端口是什么?

1 月 31 日星期五下午 4:10 更新

啊哈,我认为端口 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

这是否意味着我可能混合版本的库?

最佳答案

看起来您正在引用 JBoss AS 6 的远程容器。您应该引用 JBoss AS 7。org.jboss.arquillian.container.jbossas.remote_6

关于java - 如何为远程 JBoss 7 容器配置 arquillian,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21481016/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com