Question

Details:

  • Ant Build (with a maven extension, this is a solution at my company can't change)
  • JBoss 7
  • Container will be started independently

Setup:

I have a test as follows:

@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);
    }

}

I have an arquillian.xml as follows:

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

To my surprise if i try to use the property managementAddress arquillian would simply ignore it. Where as if i use the providerUrl it would try to connect to the defined host:port. => How is this possible? Should it not try to use managementAddress for JBoss 7?

Problem:

The arquillian.xml seems to be picked up the @TargetsContainer also seems to take effect. But nothing happens when i try to run the test. What i mean is that the deploy is not happening it's just hanging there. I am now to be unsure if i use the correct management port. Please see an extract of 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>

The error:

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

=> My quesion is what is the correct management port from the above listed ones?

Update Fri Jan 31 4:10 PM

Aha, i think port 15199 will be the correct. I did not notice i get the following error with it:

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

Could it mean i maybe mix versions of libraries?

Was it helpful?

Solution

It looks like you're referencing JBoss AS 6's remote container. You should reference JBoss AS 7. org.jboss.arquillian.container.jbossas.remote_6

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