Tutorial: EJB Service Interface

Walks you through the process of defining an Enterprise Java Bean (EJB) service interface using the Interface Mapping Toolkit (IMTK), deploying it to an enterprise server instance, and generating and running a client to access it.
Restriction: This topic applies only when the Enterprise Server feature is enabled.
Restriction: This topic applies to Windows environments only.

Before You Begin

Before beginning this tutorial, be sure that you have completed all tasks outlined in the Prerequisites section of the Tutorials: Interface Mapping Toolkit topic.

In addition, the following prerequisite software must be installed and configured:

Java JDK 1.8
Before you can successfully deploy a Java service, you must have the Java Development Kit (JDK), version 1.8 installed. Following installation, edit your Windows environment variables as follows:
  • Set the JAVA_HOME system environment variable to your Java installation directory
  • Add the path to the JAVA_HOME\bin directory to your system PATH environment variable
JBoss EAP 7.1
Before you can successfully access a Java service, you must install a Java application server. This tutorial provides instructions for using JBoss Application Server version EAP 7.1 with cumulative patch 4, available for download from the Red Hat Web site.

Following installation, continue with configuration:

  • Ensure that the JBOSS_HOME system environment variable is set to your JBoss installation directory.
  • Using any text editor, edit the standalone.xml file, located in your JBoss installation's standalone\configuration (Windows) or standalone/configuration (UNIX) directory, as follows:
    Disable the jca subsystem
    Edit the <archive-validation> child of the <subsystem xmlns="urn:jboss:domain:jca:5.0"> element to read as follows:
    <archive-validation enabled="false" fail-on-error="true" fail-on-warn="false"/>
    Add the mfcobol-notx.rar resource adapter
    Replace the existing resource-adapters subsystem element in its entirety with the following subsystem definition:
    <subsystem xmlns="urn:jboss:domain:resource-adapters:5.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>

Overview

This tutorial walks you through the following tasks:
  • Review the code in the COBOL demonstration application to become familiar with how it works
  • Create a project for the BookDemo application and EJB service interface
  • Define a Java/EJB service interface to access the COBOL application
  • Deploy the service interface to an enterprise server instance and the JBoss application server as an EJB
  • Generate a JSP client to access the service
  • Deploy the resource adapter to JBoss
  • Run the JSP client, accessing the service

Sequence

Complete this tutorial by following the instructions in the following topics in the order listed here. The bottom of each topic provides Previous topic and Next topic navigational links to help you proceed through the tutorial in its proper sequence: