Deploy the AccessBooks Java Interface

Guides you through the steps required to associate the ESDEMO enterprise server instance with your the ProgramEJB project, build the project, set deployment properties, deploy the Java interface, and verify the deployment results.

Build the ProgramEJB project

You need to build the project to generate all required deployment files.

  • On the Solution Explorer, right-click the ProgramEJB project, then click Build on the context menu.

Associate the ESDEMO enterprise server instance

You need to associate the ESDEMO enterprise server instance with your ProgramEJB project:

  1. If the Server Explorer is not visible, click View > Server Explorer from the Visual Studio menu.
  2. On the Server Explorer, expand localhost under Micro Focus Servers to see a list of available enterprise server instances.
    Attention: You might encounter an Enterprise Server Sign On dialog box as you perform the steps required to create, configure, start, or stop an enterprise server region from the Server Explorer. If you do, ensure that the Server requires credentials, Use specific server credentials, or Server is secured box is unchecked, and then click OK. Also, if prompted to disable password recovery, click No.
  3. Right-click ESDEMO; then click Associate with Project > ProgramEJB.

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 Default under Micro Focus Servers 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. From the Server Explorer, expand localhost under Micro Focus Servers to see a list of available enterprise server instances.
  2. To start the ESDEMO enterprise server instance, right-click it; then click Start.

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

Set deployment properties

To ensure that the deployment process runs smoothly, you must set some options that tell Enterprise Developer what application server to use and where to find certain files.

Set general service interface properties
  1. From the Solution Explorer, click the AccessBooks service interface.

    This activates the Properties window for AccessBooks.

  2. In the Properties window, ensure that the Interface type property is set to Java Interface (default).
  3. Ensure that the Java version is set to 11 in Application server.
Identify application files to deploy
  1. Click the Application files to deploy field, and then click its corresponding browse button Browse button.
  2. On the Add/Remove Items dialog box, click Add File.
  3. 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.

  4. Click Open.
  5. Click Add File again, and browse to your project's ProgramEJB\bin\x86\Debug folder.
  6. Select book.dll, and then click Open.

    This is the executable file you need to debug the service

  7. Click OK to close the Add/Remove Items dialog box.
Configure EJB generation
  1. In the Properties window, set the Application server to JBoss EAP installed-version.
    Note: For a list of supported JBoss versions, see Application Server JCA support for Enterprise Server.
    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
    jboss-connector-api_version-spec.jar %JBOSS_HOME%\modules\system\layers\base\javax\resource\api\main
    jboss-annotations-api_version-spec.jar %JBOSS_HOME%\modules\system\layers\base\javax\annotation\api\main
    jboss-servlet-api_version-spec.jar %JBOSS_HOME%\modules\system\layers\base\javax\servlet\api\main
  2. Add each connector class file to the Classpath as follows:
    1. On the Properties window, click the Browse button that corresponds to the Classpath field.
    2. Click Add File.
    3. Navigate to the directory that corresponds to the connector class file you want to add.
    4. Double-click the file you want to add.
    5. Repeat this sequence until all four files are added.
  3. Click OK.

Deploy the AccessBooks Java interface

  • From the Solution Explorer, right-click the AccessBooks Java interface, and then click Deploy.

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

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.

Note: If ESCWA is not already started:
  • On the Server Explorer, right-click Micro Focus Servers, and then click Administration.

    ESCWA starts in your default browser.

  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.