More instructions on how to setup JBoss EAP 6.2

I 've also used the below with success:

1. Create jboss directory

Copy jboss-eap-6.2.0.zip and unzip the file in that directory. You might as well want to change the group permissions:

chmod -R g-w jboss-eap-6.2

I have also had consistently good results with using the installer:

java -jar ~/Downloads/jboss-eap-6.2.0-installer.jar
The installer also gives you the nice option to configure standard and administrative ports at a convenient offset (e.g. +1, +2 or +100)

At any rate, following the above, cd into the jboss-eap-6.2 directory for the subsequent instructions.

2. Make a copy of the original configuration file (for safety)

cp standalone/configuration/standalone-full.xml standalone/configuration/standalone-full-original.xml

3. Add management user

(this is only applicable if you didn't use the installer but instead unziped the archive) Execute:
./bin/add-user.sh
… and go with the flow.

4. Configure datasources

For datasources which roll-over, add the following parameter:

<url-delimiter>|</url-delimiter>

I used something along the below lines to configure a Sybase datasource (yes, that zombie just won't die)

<subsystem xmlns="urn:jboss:domain:datasources:1.1"> <datasources> <datasource jta="false" jndi-name="java:jboss/datasources/sqlDataSource" pool-name="sqlDataSource" enabled="true" use-ccm="false"> <connection-url>jdbc:sybase:Tds:231.102.107.30:2545/mydatabase</connection-url> <driver-class>com.sybase.jdbc4.jdbc.SybDriver</driver-class> <driver>sybase</driver> <security> <user-name>username</user-name> <password>secret</password> </security> <pool> <min-pool-size>0</min-pool-size> <max-pool-size>15</max-pool-size> </pool> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> <validation> <validate-on-match>true</validate-on-match> <check-valid-connection-sql>select 1 from mydatabase..sometable</check-valid-connection-sql> <background-validation>false</background-validation> </validation> <timeout> <idle-timeout-minutes>1</idle-timeout-minutes> </timeout> <statement> <share-prepared-statements>true</share-prepared-statements> <prepared-statement-cache-size>10</prepared-statement-cache-size> </statement> </datasource> </datasources> </subsystem>

5. Configure JNDI aliases for datasources

This is only for reasons of backwards compatibility if you wish to change some names and at the same time allow old code to continue using the old names.

In such a case, you can add the following to the naming subsystems:

<subsystem xmlns="urn:jboss:domain:naming:1.4"> <bindings> <lookup name="java:/someName" lookup="java:jboss/datasources/someNameB"/> <lookup name="java:/anotherName" lookup="java:jboss/datasources/anotherNameB"/> </bindings> <remote-naming/> </subsystem>

I've verified that with the above, you can use the below code to obtain a datasource (from a Web application) using e.g. either java:jboss/datasources/someNameB or java:/someName.

InitialContext cxt = new InitialContext();
if ( cxt == null ) {
    throw new RuntimeException("Uh oh -- no context!");
}
DataSource ds = (DataSource) cxt.lookup( "java:jboss/datasources/someNameB" ); // you can use "java:/someName" as well

6. Add the Sybase driver as a module:

mkdir -p modules/com/sybase/main

… subsequently, copy jconn4.jar in there.

Following that, create a file module.xml with the below content:

<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.0" name="com.sybase"> <resources> <resource-root path="jconn4.jar"/> </resources> <dependencies> <module name="javax.api"/> <module name="javax.transaction.api"/> </dependencies> </module>

I've also had success in using the open-source JTDS driver instead (jtds-1.3.1.jar).

7. Make web & interface pages public

Unless you do the below I think JBoss binds only to the local loopback address (127.0.0.1) <interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:0.0.0.0}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:0.0.0.0}"/> </interface> <interface name="unsecure"> <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/> </interface> </interfaces>

8. Ensure that enable-welcome-root is set to true

The enable-welcome-root attribute should be set to true (I believe it is by default) if you wish to see the "Welcome to JBoss EAP 6.2" page <subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="default-host" native="false"> <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/> <virtual-server name="default-host" enable-welcome-root="true"> ... … otherwise (if set to false) when you hit, e.g. localhost:8080 you'd get HTTP 404. People typically set this to false in order to deploy their own root application.

9. Configure access logging

Add the following in subsystem urn:jboss:domain:web:1.5 after <connector... />:

<virtual-server name="default-host" enable-welcome-root="true"> <alias name="localhost"/> <alias name="example.com"/> <access-log pattern="%a %t %H %r %s %S %b %D '%{Referer}i' '%{User-Agent}i' " rotate="true" prefix="access_log."> <directory relative-to="jboss.server.log.dir"/> </access-log> </virtual-server> … this will allow you to view access logs (in a separate file for convenience).

NB: access logging is buffered and writes the access logs in chunks.

10. Customize logging

If you're that kind of person you might wish to further customize logging in urn:jboss:domain:logging:1.3:

<periodic-rotating-file-handler name="FILE" autoflush="true"> <formatter> <pattern-formatter pattern="[%d{dd/MMM/yyyy:HH:mm:ss,SSS Z}] %-5p [%c] (%t) %s%E%n"/> </formatter> <file relative-to="jboss.server.log.dir" path="server.log"/> <suffix value=".yyyy-MM-dd"/> <append value="true"/> </periodic-rotating-file-handler>

I have done a more thorough writeup specifically on logging here.

11. Start server and experience joy

./bin/standalone.sh  -c standalone-full.xml >& /dev/null &