To Deploy to JBoss

Restriction: This topic applies only when the Enterprise Server feature is enabled.

Installing JBoss Application Server

You can download JBoss Application Server from http://jbossas.jboss.org/downloads, and install it from there.

To open JBoss Application Server:

  • Enter the URL http://localhost:8080 in your Web browser, where 8080 is the default port.

Administering JBoss Application Server

JBoss Application Server provides a Web interface for administering the application server. This administration interface is called the JBoss console. To start the console:

  • Enter http://localhost:8080/jmx-console/ in your Web browser, where 8080 is the default port.

Setting up JBoss Application Server

For JBoss 5.1 and 6.1, the JBoss Application Server provides deployment descriptors. The deployment descriptors require some changes before generating EJBs. These changes are described below, in which your JBoss installation directory is the top-level directory of your JBoss installation.

JBoss 5.1
Using any text editor, edit the following JBoss files as specified here:
run.bat
Located in your JBoss installation's bin directory.

Insert a SET statement to set the JAVA_HOME environment variable to the directory containing your JDK. For example:

set JAVA_HOME=c:\program files\java\jdk1.6

jboss-service.xml
Located in your JBoss installation's server\default\conf directory.

Set the callByValue attribute to true:

<attribute name="callByValue">true</attribute>

war-deployers-jboss-beans.xml
Located in your JBoss installation's server\default\deployers\jbossweb.deployer\META-INF directory.

Set the java2ClassLoadingCompliance property to true:

<property name="java2ClassLoadingCompliance">true</property>

ear-deployer-jboss-beans.xml
Located in your JBoss installation's server\default\deployers directory.

Set the isolated property to false:

<property name="isolated">false</property>

Set the callByValue property to true:

<property name="callByValue">true</property>

jboss-ra.xml (optional)
Included in the mfcobol-notx.rar archive file located by default in the %ProgramFiles(x86)%\Micro Focus\Visual COBOL for Visual Studio 2012\javaee\javaee5\jboss5 directory.

To enable tracing, set the trace attribute to true:

<attribute name="trace">true</attribute>

JBoss 6.1
Using any text editor, edit the following JBoss files as specified here:
naming-jboss-beans.xml
Located in your JBoss installation's server\default\deploy directory.

Set the callByValue property to true:

<property name="callByValue">true</property>

ear-deployer-jboss-beans.xml
Located in your JBoss installation's server\default\deployers directory.

Set the isolated property to false:

<property name="isolated">false</property>

Set the callByValue property to true:

<property name="callByValue">true</property>

ejb-deployer-jboss-beans.xml
Located in your JBoss installation's server\default\deployers directory.

Set the callByValue property to true:

<property name="callByValue">true</property>

war-deployers-jboss-beans.xml
Located in your JBoss installation's server\default\deployers\jbossweb.deployer\META-INF directory.

Set the java2ClassLoadingCompliance property to true:

<property name="java2ClassLoadingCompliance">true</property>

jboss-ra.xml (optional)
Included in the mfcobol-notx.rar archive file located by default in the %ProgramFiles(x86)%\Micro Focus\Visual COBOL for Visual Studio 2012\javaee\javaee6\jboss6 directory.

To enable tracing, set the trace attribute to true:

<attribute name="trace">true</attribute>

Starting and Stopping JBoss Application Server

You can start and stop JBoss Application Server from the JBoss console or from the command line, as follows.

JBoss 5.1 and 6.1
  • Run jboss_home\bin\run.bat to start it.
  • Run jboss_home\bin\shutdown.bat -S to stop it.
JBoss 7.1
  • Run jboss_home\bin\standalone.bat to start it.
  • Run jboss_home\bin\jboss-cli --connect command=:shutdown to stop it.

Deploying the Resource Adapter

JBoss 5.1 and 6.1

Resource adapters, named mfcobol*.rar, are supplied together with JBoss-specific deployment descriptors for using the resource adapters with the JBoss Application Server. The descriptors have names corresponding to the resource adapters, as follows:

  • mfcobol-notx-ds.xml is the descriptor for the resource adapter mfcobol-notx.rar
  • mfcobol-localtx-ds.xml is for mfcobol-localtx.rar
  • mfcobol-xa-ds.xml is for mfcobol-xa.rar

To deploy a resource adapter:

  1. Copy the appropriate .rar file into your JBoss deployment directory, which by default is jboss_home\server\default\deploy.
  2. Copy the corresponding deployment descriptor,*ds.xml , for the resource adapter into the same directory. For example, if you are deploying mfcobol-notx.rar, copy mfcobol-notx-ds.xml.
JBoss 7.1
To deploy a resource adapter for JBoss 7.1, update the standalone.xml file, located in your JBoss installation's standalone\configuration directory, as follows:
<subsystem xmlns="urn:jboss:domain:jca:1.1"> element
Edit the <archive-validation>, child of the <subsystem xmlns="urn:jboss:domain:jca:1.1"> element, to disable it:

<archive-validation enabled="false" fail-on-error="true" fail-on-warn="false"/>

Add the mfcobol-notx.rar resource adapter
As a child of <profile>, add the following <subsystem> to standalone.xml:
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
	<resource-adapters>
		<resource-adapter>
			<archive>mfcobol-notx.rar</archive>
			<transaction-support>NoTransaction</transaction-support>
			<connection-definitions>
				<connection-definition class-name="com.microfocus.cobol.connector.spi.CobolNoTxManagedConnectionFactory" jndi-name="java:/eis/MFCobol_v1.5" pool-name="CobolConnectionFactory">
					<pool>
						<min-pool-size>2</min-pool-size>
						<max-pool-size>10</max-pool-size>
					</pool>
					<security>
						<application/>
					</security>
				</connection-definition>
			</connection-definitions>
		</resource-adapter>
	</resource-adapters>
</subsystem>
Add the mfcobol-localtx.rar resource adapter
As a child of <profile>, add the following <subsystem> to standalone.xml:
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
	<resource-adapters>
		<resource-adapter>
			<archive>mfcobol-localtx.rar</archive>
			<transaction-support>LocalTransaction</transaction-support>
			<connection-definitions>
				<connection-definition class-name="com.microfocus.cobol.connector.spi.CobolLocalTxManagedConnectionFactory" jndi-name="java:/eis/MFCobol_v1.5" pool-name="CobolConnectionFactory">
					<pool>
						<min-pool-size>2</min-pool-size>
						<max-pool-size>10</max-pool-size>
					</pool>
					<security>
						<application/>
					</security>
				</connection-definition>
			</connection-definitions>
		</resource-adapter>
	</resource-adapters>
</subsystem>
Add the mfcobol-xa.rar resource adapter
As a child of <profile>, add the following <subsystem> to standalone.xml:
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
	<resource-adapters>
		<resource-adapter>
			<archive>mfcobol-xa.rar</archive>
			<transaction-support>XATransaction</transaction-support>
			<connection-definitions>
				<connection-definition class-name="com.microfocus.cobol.connector.spi.CobolManagedConnectionFactory" jndi-name="java:/eis/MFCobol_v1.5" pool-name="CobolConnectionFactory">
					<xa-pool>
						<min-pool-size>2</min-pool-size>
						<max-pool-size>10</max-pool-size>
					</xa-pool>
					<security>
						<application/>
					</security>
				</connection-definition>
			</connection-definitions>
		</resource-adapter>
	</resource-adapters>
</subsystem>

Deploying the Application .ear File

When you generate an application .ear file the JBoss Application Server requires that the .ear file contains deployment descriptors that specify deployment information about your application. When you use generate a client and EJB using the Interface Mapping Toolkit, these deployment descriptors are automatically created and packaged into the .ear.

JBoss 5.1 and 6.1
To deploy your application .ear file:
  1. Copy the application .ear file from the directory my-project\repos\my-service.deploy\my-service.ear into your JBoss deployment directory which is, by default, jboss_home\server\default\deploy
JBoss 7.1
Copy the application .ear file from the directory my-project\repos\my-service.deploy\my-service.ear into your JBoss deployment directory which is, by default, jboss_home\standalone\deployments

Logging

JBoss 5.1 and 6.1
JBoss stores log files and traces by default in jboss_home\server\default\log\server.log.
JBoss 7.1
JBoss stores log files and traces by default in jboss_home\standalone\log\server.log.

Configuring a JDBC Data Source for XA Transactions

If the application being deployed connects to a third-party database, you need to configure a JDBC data source and specify information such as the JNDI name of the data source.

JBoss 5.1 and 6.1
For an Oracle database, edit the Oracle-supplied deployment descriptor oracle-xa-ds.xml.
JBoss 7.1
Add a data source to the standalone.xml file.

For full details see the JBoss administration documentation on configuring JDBC data sources.

Further Information

For further information, see the Release Notes for your JBoss Application Server installation and the JBoss Web site.