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.
Restriction: This topic applies only when the Enterprise Server feature is enabled.
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.
Set deployment properties
To ensure that the deployment process runs smoothly, you must set some options that tell
Visual COBOL
what application server to use and where to find certain files.
- Set general service interface properties
-
- From the
Solution Explorer, click the
AccessBooks service interface.
This activates the
Properties window for
AccessBooks.
- In the
Properties window, ensure that the
Interface type property is set to
Java Interface (default).
- Identify application files to deploy
-
- Click the
Application files to deploy field, and then click its corresponding browse button
.
- On the
Add/Remove Items dialog box, click
Add File.
- 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.
- Click
Open.
- Click
Add File again, and browse to your project's
ProgramEJB\bin\x86\Debug folder.
- Select
book.dll, and then click
Open.
This is the executable file you need to debug the service
- Click
OK to close the
Add/Remove Items dialog box.
- Configure EJB generation
-
- In the
Properties window, set the
Application server to
JBoss EAP 7.1.4 (Java7).
Now you need to add three EJB connector class files to the Java EE Class Path, one each for the Java EJB, resource, and servlet
files. The file names and locations are:
Filename
|
Located in
|
jboss-ejb-api_3.2_spec-1.0.0.Final-redhat-1.jar
|
%JBOSS_HOME%\modules\system\layers\base\javax\EJB\api\main
|
jboss-connector-api_1.7_spec-1.0.0.Final-redhat-1.jar
|
%JBOSS_HOME%\modules\system\layers\base\javax\resource\api\main
|
jboss-servlet-api_3.1_spec-1.0.0.Final-redhat-1.jar
|
%JBOSS_HOME%\modules\system\layers\base\javax\servlet\api\main
|
- Add each connector class file to the Classpath as follows:
- On the
Properties window, click the
Browse button that corresponds to the
Classpath field.
- Click
Add File.
- Navigate to the directory that corresponds to the connector class file you want to add.
- Double-click the file you want to add.
- Repeat this sequence until all three files are added.
- Click
OK.
Associate the ESDEMO enterprise server instance
You need to associate the ESDEMO
enterprise server instance with your
ProgramEJB project:
- On the
Server Explorer, expand
localhost under
Micro Focus Servers to see a list of available
enterprise server instances.
- 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:
- On the
Server Explorer, expand
localhost
under
Micro Focus Servers to see a list of
enterprise server instances.
- 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
.
Start the ESDEMO
enterprise server instance
Before deploying your service interface, you must start the ESDEMO instance where the AccessBooks service will run.
- From the
Server Explorer, expand
localhost
under
Micro Focus Servers to see a list of available
enterprise server instances.
- To start the
ESDEMO
enterprise server instance, right-click it; then click
Start.
Note: If this is the first time you have started the server, you see a sign-on dialog box. If
Server is secured is checked, uncheck it; then click
OK. Unchecking
Server is secured prevents this dialog box from showing when you subsequently start the region. If
Server is secured is not checked, simply click
OK to clear the dialog box. Also, if prompted to disable password recovery, click
No.
The
Enterprise Server Console Daemon is then invoked, starting the
enterprise server instance.
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
Enterprise Server Administration.
- Start
Enterprise Server Administration
- If you haven't already done so, start Enterprise Server Administration as follows:
- View service details
-
- On the
Enterprise Server Administration
Home page, look at the
Objects column that corresponds to the ESDEMO server.
You should see that the number of running services is at least nine. These are the five that come standard with the ESDEMO
enterprise server, plus the one service you added containing four operations. You might see more if you have deployed other
services to the ESDEMO
enterprise server instance.
- Click the
Details button for ESDEMO Services.
In the row showing your new service,
AccessBooks, you see that the
Current Status column shows all four operations as
Available. This means that the service is ready to be accessed.
- Close the
Visual Studio
Enterprise Server Administration window.