JBoss Community Archive (Read Only)


JBoss EAP 5.1 - Remote

A DeployableContainer implementation that can connect to and run tests in a JBoss EAP 5.1 instance running locally or on a separate machine (effectively a different JVM). This implementation has no lifecycle support, so it can not be started or stopped.

Container adapter selection

Arquillian has adapters for the JBoss Application Server 5.1 (the community project), but does not have distinct adapters for the JBoss Enterprise Application Platform 5.1, the product based on the community project.

However, Arquillian can be configured to run tests on JBoss EAP 5.1 using a mix of JBoss AS 5.1 and JBoss AS 6.0 dependencies and by updating the JBoss EAP 5 profile service to disable authentication.

Supported injections

Container Injection Support Matrix


@EJB (no-interface)

@Inject (CDI)

@Inject (MC)

@PersistenceContext @PersistenceUnit






Profile service modification

If authentication is enabled in the JBoss EAP 5 profile service, Arquillian will be unable to deploy the archive. If that's the case, we'll need to disable it. (See the last section of this chapter to learn how to setup Arquillian to authenticate properly).

To disable authentication, edit the file deploy/profileservice-jboss-beans.xml and comment out the following beans nested within the ProfileServiceProxyFactory bean as shown:

<!-- comment this list to disable auth checks for the profileservice -->
                <value-factory bean="JNDIBasedSecurityManagement"
                    method="getAuthenticationManager" parameter="jmx-console"/>
                <value-factory bean="JNDIBasedSecurityManagement"
                    method="getAuthenticationManager" parameter="jmx-console"/>
                <value-factory bean="JNDIBasedSecurityManagement"
                    method="getAuthenticationManager" parameter="jmx-console"/>

Arquillian dependencies

Add the necessary Arquillian dependencies for executing the tests inside/against a JBoss EAP 5.1 server that has been started and is available via localhost. We'll use a Maven profile named arquillian-jboss-eap-5.1-remote.

Note that Arquillian with JBoss EAP 5.1 requires the JBoss AS 5.1 client, but the JBoss AS 6.0 profile service client.


The parent of the jboss-as-client dependency (jboss-as-parent) includes repository configuration for the old JBoss Maven repository (http://repository.jboss.org/maven2). Therefore, a mirror has to be configured in the Maven settings.xml file so that this repository is replaced with the new JBoss Nexus (Deprecated) repository (https://repository.jboss.org/nexus).

<settings xmlns="http://maven.apache.org/POM/4.0.0"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-4.0.0.xsd">
            <name>JBoss Deprecated Repository</name>

Secure server support

If you aren't able to disable the authentication on the profile service, you can instead configure Arquillian to authenticate properly.

If you haven't done so already, create an Arquillian configuration file, arquillian.xml, on the classpath (e.g., src/test/resources). Add the following container configuration for the JBoss EAP 5.1 adapter:

<?xml version="1.0" encoding="UTF-8"?>
<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="jboss-eap-5.1" default="true">
            <property name="contextFactory">org.jboss.security.jndi.LoginInitialContextFactory</property>


Next, create an authentication configuration file, auth.conf, on the classpath (e.g., src/test/resources).

jmx-console {
    org.jboss.security.ClientLoginModule required;

Next, create a JNDI properties file, jndi.properties, on the classpath (e.g., src/test/resources) to set the authentication credentials and activate the configuration:


Finally, add a build element to the Maven profile defined above to set a system variable that activates the authentication configuration when the tests are run.


In summary, we added the contextFactory configuration property in arquillian.xml, an auth.conf file, a jndi.properties file and passed -Djava.security.auth.login.config= to the Maven Surefire plugin.

You can run the test in Eclipse using the the "Maven test" option provided by the Maven Integration for Eclipse plugin. The test will work just as it does from the commandline.

To run the test using the internal JUnit runner in Eclipse, you need to set java.security.auth.login.config needs in the Run Configuration for each test.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-10 09:40:58 UTC, last content change 2012-11-30 10:25:58 UTC.