This document explains how to configure JBoss to run the gateway application.
This document assumes that you have a fresh install of JBoss. If not, please see Installing the JBoss Application Server on Debian GNU/Linux 4.0 (etch) . This document also assumes that you have completed the Database Setup. If not, please see Setting up the Database .
Due to the file layout, the way the EAR file is constructed, and the way classes are loaded by default, our application doesn't work out of the box on JBoss. One particular class loader setting has to be changed. It is really important that you make this change, otherwise you will get tons of ClassCastExceptions and MethodInvocationExceptions.
Edit /opt/jboss/server/default/deploy/jboss-web.deployer/META-INF/jboss-service.xml setting UseJBossWebLoader to true .
If you plan on using a MySQL data source, you'll need to download a copy of MySQL Connector/J from the MySQL website and drop it in /opt/jboss/server/default/lib/ .
Edit /config/host/localhost/gateway-ds.xml . The default gateway-ds.xml file that comes with the gateway is configured for Hypersonic SQL. The example below shows a gateway-ds.xml file that is configured for MySQL. Use it as a guide for setting up your data source file. Remember to replace YOUR_PASSWORD_HERE with the database password you want to use.
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<xa-datasource>
<jndi-name>GatewayDS</jndi-name>
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:mysql://localhost:3306/gateway</xa-datasource-property>
<user-name>gateway</user-name>
<password>YOUR_PASSWORD_HERE</password>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<max-pool-size>50</max-pool-size>
<min-pool-size>0</min-pool-size>
<blocking-timeout-millis>2000</blocking-timeout-millis>
<idle-timeout-minutes>2</idle-timeout-minutes>
<new-connection-sql>set autocommit=1</new-connection-sql>
<track-connection-by-tx>true</track-connection-by-tx>
<no-tx-separate-pools>true</no-tx-separate-pools>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</xa-datasource>
</datasources>
Once you have the file edited, copy it into /opt/jboss/server/default/deploy/
The Enterprise Archive (EAR) file is named something like gateway-ear-4.5.1.ear . If you downloaded the binary package, it should be located in the top level directory of the ZIP file. If you built it from source code, the file will be located in the gateway-ear-jboss/target directory.
Once you have located the file, copy it into /opt/jboss/server/default/deploy/
$ sudo /etc/init.d/jboss start