Previous Topic Next topic Print topic


To Deploy to JBoss

This topic describes how to deploy an application developed using the Interface Mapping Toolkit to JBoss Application Server.

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. These are packaged into the application archive (.ear) files when you generate EJBs using the Interface Mapping Toolkit. 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 (Windows) or server/default/conf (UNIX) 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 (Windows) or server/default/deployers/jbossweb.deployer/META-INF (UNIX) 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 (Windows) or server/default/deploy (UNIX) 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\Enterprise Developer\javaee\javaee5\jboss5 (Windows) or $COBDIR/javaee/javaee5/jboss5 (UNIX) 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 (Windows) or server/default/deploy (UNIX) 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 (Windows) or server/default/deploy (UNIX) 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 (Windows) or server/default/deploy (UNIX) 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\jboss-web.deployer\META-INF (Windows) or server/default/deployers/jboss-web.deployer/META-INF (UNIX) 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\Enterprise Developer\javaee\javaee6\jboss6 (Windows) or $COBDIR/javaee/javaee6/jboss6 (UNIX) 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

For Windows environments :

  • Run jboss_home\bin\run.bat to start it.
  • Run jboss_home\bin\shutdown.bat -S to stop it.

For UNIX environments :

  • Run jboss_home/bin/run.bat to start it.
  • Run jboss_home/bin/shutdown.bat -S to stop it.
JBoss 7.1

For Windows environments :

  • Run jboss_home\bin\standalone.bat to start it.
  • Run jboss_home\bin\jboss-cli --connect command=:shutdown to stop it.

For UNIX environments :

  • Run jboss_home/bin/run.bat to start it.
  • Run jboss_home/bin/shutdown.bat -S 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 (Windows) or jboss_home/server/default/deploy (UNIX).
  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 (Windows) or standalone/configuration (UNIX) 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.earmy-project/repos/my-service.deploy/my-service.ear into your JBoss deployment directory which is, by default, jboss_home\server\default\deployjboss_home/server/default/deploy
JBoss 7.1
Copy the application .ear file from the directory my-project\repos\my-service.deploy\my-service.earmy-project/repos/my-service.deploy/my-service.ear into your JBoss deployment directory which is, by default, jboss_home\standalone\deploymentsjboss_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.logjboss_home\server\default\log\server.log.
JBoss 7.1
JBoss stores log files and traces by default in jboss_home\standalone\log\server.logjboss_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.

Previous Topic Next topic Print topic