Restriction: This topic applies only when the Enterprise Server feature is enabled.
Important: The instructions in this topic assume that you have created a Liberty server profile, including a
server.xml file, which is required before deploying an EJB or a resource adapter to Liberty. See your WebSphere Liberty documentation
for details.
To start WebSphere Liberty
- Log in as WebSphere administrator. See the WebSphere documentation.
- Run the startup script by entering the following command from the
bin directory of your WebSphere installation:
startserver.sh myServer
To deploy the resource adapter
- Install the WebSphere Liberty
servlet-3.1,
jca-1.7, and
ejbRemote-3.2 features, which are not installed by default. To do this, you must run the
installUtility command from the
bin directory of your WebSphere Liberty installation. For example, the command-line to install the
servlet-3.1 feature might look something like this:
installUtility install servlet-3.1
See your WebSphere Liberty documentation for details.
- Add the following code at the top of the
server.xml file for your Liberty profile. This code enables the minimum subset of features required for resource adapter and EJB support:
<featureManager>
<feature>ejbRemote-3.2</feature>
<feature>ejbLite-3.2</feature>
<feature>localConnector-1.0</feature>
<feature>jca-1.7</feature>
<feature>jsp-2.3</feature>
<feature>servlet-3.1</feature>
<feature>jndi-1.0</feature>
</featureManager>
Note: To avoid a conflict with the
servlet-3.1 feature, do not add the
webProfile-8.0 feature to the same
server.xml file.
- Also in the
server.xml file, add a definition for the type of resource adapter you are using:
- Non-transactional
-
<resourceAdapter id="mfcobol-notx" location="<PathToResourceAdapter>\mfcobol-notx.rar" >
<classloader apiTypeVisibility="spec, ibm-api, stable, api"/>
</resourceAdapter>
- XA
-
<resourceAdapter id="mfcobol-notx" location="<PathToResourceAdapter>\mfcobol-xa.rar" >
<classloader apiTypeVisibility="spec, ibm-api, stable, api"/>
</resourceAdapter>
- Local transaction
-
<resourceAdapter id="mfcobol-localtx" location="<PathToResourceAdapter>\mfcobol-localtx.rar" >
<classloader apiTypeVisibility="spec, ibm-api, stable, api"/>
</resourceAdapter>
- Add a connection factory. For example, the following code defines a connection factory that specifies some of the resource
adapter properties:
<connectionFactory jndiName="eis/MFCobol_v1.5">
<resource-ref id="CCIMFCobol_v1.5">
<res-ref-name>CCIMFCobol_v1.5</res-ref-name>
</resource-ref>
<properties.mfcobol-notx ServerHost="localhost"/>
<properties.mfcobol-notx ServerPort="9003"/>
<properties.mfcobol-notx Trace="false"/>
<properties.mfcobol-notx EnhancedTrace="false"/>
</connectionFactory>
Important: Within the connection factory definition, you can override the values for properties defined in the resource adapter's
ra.xml file, such as the
Trace and
ServerPort properties as shown in the above example. However, do not alter the values for the
resource-ref id (CCIMFCobol_v1.5) and the
jndiName (eis/MFCobol_v1.5). Any alteration of these values prevents the resource adapter from working properly with Micro Focus-generated EJBs.
To deploy an EJB to Liberty
Add an application definition to your
server.xml file. The definition must include the path to your
.ear file, and specify that the application uses the same class loader as the resource adapter. For example, the application definition
to deploy an EJB that uses a non-transactional resource adapter might look like this:
<application id="TestApp" name=" TestApp" type="ear" location="..\ear\TestApp.ear">
<classloader classProviderRef="mfcobol-notx" />
</application>
To stop the Liberty server
At a command prompt, enter the following command from the
bin directory of your WebSphere Liberty installation:
server stop server_name