1

I am testing jax-rs web services with Arquillian, and I use an embedded Wildfly 10 container. This is my pom.xml:

..  
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-bom</artifactId>
            <version>1.1.13.Final</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>

..

<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>test</scope>
</dependency>   

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>7.0</version>
</dependency>

<dependency>
    <groupId>org.jboss.arquillian.junit</groupId>
    <artifactId>arquillian-junit-container</artifactId>
    <scope>test</scope>
</dependency>

<dependency>
    <groupId>org.wildfly.arquillian</groupId>
    <artifactId>wildfly-arquillian-container-embedded</artifactId>
    <version>2.1.0.Final</version>
</dependency>

..

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <!-- You need the maven dependency plugin to download locally a zip with 
            the server, unless you provide your own, it will download under the /target 
            directory -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <id>unpack</id>
                    <phase>process-test-classes</phase>
                    <goals>
                        <goal>unpack</goal>
                    </goals>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>org.wildfly</groupId>
                                <artifactId>wildfly-dist</artifactId>
                                <version>10.1.0.Final</version>
                                <type>zip</type>
                                <overWrite>false</overWrite>
                                <outputDirectory>target</outputDirectory>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.20.1</version>
            <configuration>
                <!-- Fork every test because it will launch a separate AS instance -->
                <forkMode>always</forkMode>
                <systemPropertyVariables>
                    <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                </systemPropertyVariables>
                <redirectTestOutputToFile>false</redirectTestOutputToFile>
            </configuration>
        </plugin>

    </plugins>
</build>

.. with arquillian.xml in src/test/resources:

<arquillian xmlns="http://jboss.org/schema/arquillian"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

<container qualifier="wildfly10" default="true">
    <configuration>
        <property name="jbossHome">target/wildfly-10.1.0.Final/</property>
        <property name="modulePath">target/wildfly-10.1.0.Final/modules</property>
    </configuration>
</container>

.. But when type: mvn clean verify, I get the following error: WFLYPRT0023: Could not connect to remote+http://127.0.0.1:9990. The connection timed out

Manuel
  • 205
  • 1
  • 4
  • 17
  • Have you verified that anything is listening at on that port? Have you verified that you can actually reach this address from the same host? No one is going to be able to easily troubleshoot this for you, as it is highly environmental. So you'll have to show some steps to get the obvious stuff out of the way. –  Sep 20 '17 at 15:05
  • yes, nothing is listening on that port....I am not sure wildfly 10 could run as embedded container – Manuel Sep 20 '17 at 15:47
  • Looks like they changed ids: https://developer.jboss.org/thread/267938?_sscc=t If this answers the question, you could answer it yourself for some sweet, sweet rep. –  Sep 20 '17 at 16:01

1 Answers1

0

This question was one of the first links I found in Google about error WFLYPRT0023.

I got the same error code when connecting via jboss-cli and fixed it by setting the time-out on the command line.

The default time-out is 5000 milliseconds which doesn't seem to be nearly enough, especially when the network is slow.

This sets the time-out to 30 seconds

jboss-cli.bat --timeout=30000  ...

As far as setting this in Arquillian is concerned, you should be able to add the

startupTimeoutInSeconds

property in your

arquillian.xml

file. I assume that this setting is the same as the one above.

There is some more information about Arquillian here Arquillian and Wildfly: set timeout for management connection

DAB
  • 1,631
  • 19
  • 25