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.

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:

JDK 1.8
To successfully deploy and access a Java service, you must have the Java Development Kit (JDK) and a Java application server installed. The Java JDK version 1.8 is installed automatically with Visual COBOL. No further configuration is required.
JBoss EAP 7.1
This tutorial provides instructions for using JBoss Application Server version EAP 7.1 with cumulative patch 4. Therefore, to complete the tutorial successfully, install and configure the JDK and JBoss software as required.

Using any text editor, edit the standalone.xml file, located in your JBoss installation's standalone\configuration 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

In this tutorial, we take you through the following tasks:
  • Review the code in the COBOL demonstration application to become familiar with how it works
  • Create a Visual Studio solution and project for the ScheduleDemo 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 as an EJB
  • Generate and deploy 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: