Deploy the AccessBooks Java Interface

Guides you through the steps required to set deployment properties, deploy the Java interface, and verify the deployment results.

Stop enterprise server instances

To ensure that your enterprise server instance does not encounter any port conflicts with other enterprise server instances that use the same listener port, stop all started enterprise server instances, if any, as follows:

  1. On the Server Explorer, expand Local [localhost:10086] > Default [127.0.0.1:86] to see a list of enterprise server instances.
  2. Right-click each started enterprise server instance, and stop it by selecting Stop from the context menu.
    Note: Started enterprise server instances show with a green icon Started enterprise server instance.

Start the ESDEMO enterprise server instance

Before deploying your service interface, you must start the ESDEMO instance where the AccessBooks service will run.

  1. If the Server Explorer in Visual COBOL is not active, click Window > Show View > Other > Micro Focus > Server Explorer; then click OK.
  2. From the Server Explorer, expand Local [localhost:10086] to see a list of available enterprise server instances.
  3. To start the ESDEMO enterprise server instance, right-click it; then click Start.

    ESDEMO provides a default user name and password that you can customize. For this tutorial, you use the default information.

  4. If a sign-on dialog box appears, click OK.

The Enterprise Server Daemon is then invoked via the Console, starting the enterprise server instance.

Set deployment properties

To ensure that the deployment process runs smoothly, you must set some options that tell Visual COBOL the name of your enterprise server instance, what application server to use, and where to find certain files.

Open Java interface properties
  1. On the COBOL Explorer in the ProgramEJB project, expand Java Interfaces
  2. Right-click the AccessBooks Java interface; then select Properties from the context menu.
Configure general properties
  1. On the General tab, click EJB Generation (default).
  2. On the Deployment Server tab, click Change that corresponds to the Enterprise Server name field.

    This opens the Select Enterprise Server dialog box.

  3. Select the ESDEMO server, and then click OK.
Identify application files to deploy
  1. On the Application Files tab, click Legacy application needs deploying; then click Add Files.
  2. Browse to your project's ProgramEJB folder, and select the following files:
    • bookfile.dat
    • bookfile.idx

    These are the data and index files accessed by the service.

  3. Click Open.
  4. Click Add Files again, and browse to your project's New_Configuration.bin folder.
  5. Select book.dll (Windows) or (UNIX) , and then click Open.

    This is the executable file you need to debug the service.

Configure EJB generation
  1. On the EJB Generation tab, use the Application Server drop-down lists to select JEE 7 and JBoss EAP installed-version.
  2. Uncheck Transactional.
  3. In the Java compiler field, type the location of your javac.exe file.
    Now you need to add four connector class files to the Java EE Class Path, one each for the Java EJB, resource, annotation, and servlet files. The file names and locations are as follows, where version-spec represents the version specification for your JBoss installation:
    Filename Located in
    jboss-ejb-api_version-spec.jar %JBOSS_HOME%\modules\system\layers\base\javax\EJB\api\main (Windows) or $JBOSS_HOME/modules/system/layers/base/javax/EJB/api (UNIX)
    jboss-connector-api_version-spec.jar %JBOSS_HOME%\modules\system\layers\base\javax\resource\api\main (Windows) or $JBOSS_HOME/modules/system/layers/base/javax/resource/api/main (UNIX)
    jboss-annotations-api_version-spec.jar %JBOSS_HOME%\modules\system\layers\base\javax\annotation\api\main (Windows) or $JBOSS_HOME/modules/system/layers/base/javax/annotation/api/main (UNIX)
    jboss-servlet-api_version-spec.jar %JBOSS_HOME%\modules\system\layers\base\javax\servlet\api\main (Windows) or $JBOSS_HOME/modules/system/layers/base/javax/servlet/api/main (UNIX)
  4. Add each connector class file to the Java EE Class Path as follows:
    1. Click the Browse button that corresponds to the Java EE Class Path field.
    2. Navigate to the directory location that corresponds to the connector class file you want to add.
    3. Double-click the file you want to add.
    4. Repeat this sequence until all four files are added.
  5. Click OK.

Deploy the AccessBooks Java interface

  1. From the COBOL Explorer, right-click the AccessBooks Java interface, and then click Deploy.
  2. In Eclipse, click the Console tab.
  3. On the icon bar, click the down arrow associated with Display Selected Console Display Selected Console.
  4. Click Service Interfaces Console.

The Console shows the progression of the deployment process. If deployment was successful, you should see a message indicating success.

Note: If the console switches to the Micro Focus Build view after deployment, switch the view back to Service Interfaces Console to review the deployment log.

If deployment ever fails, you should find a message in the output window indicating why it failed. Also, the failure message contains the path to the deployment log file. You can type the address into a browser and view the log file from there.

View deployment results

Now that your Java interface has been deployed as a service running on the ESDEMO enterprise server instance, you can look at the details of the deployed service in ESCWA.

  1. In ESCWA, click NATIVE.
  2. In the navigation pane, expand Directory Servers > Default, and double-click the ESDEMO enterprise server instance.
  3. On the GENERAL drop-down list, select Services.

    At the bottom of the right pane, you should see all four operations marked as Available. This means that the Java interface is ready to be accessed by a client.

  4. Close ESCWA.