Walks you through the steps required to associate an
enterprise server instance with your project, build the project, set deployment properties, deploy the service interface, and verify the deployment
results.
Restriction: This topic applies only when the Enterprise Server feature is enabled.
Restriction: This topic applies to Windows environments (local development) only.
To successfully deploy a Java service interface to an
enterprise server instance, you need to first set some options in
Visual COBOL.
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.
- From the
COBOL Explorer in the
ProgramEJB project, expand
Java Interfaces
- Right-click the
ProgramEJB Java interface; then select
Java Properties from the context menu.
- On the
General tab, click
EJB Generation (default).
- On the
Deployment Server tab, click
Change that corresponds to the
Enterprise Server name field.
This opens the
Select Enterprise Server dialog box.
- Select the
ESDEMO Server, and then click
OK.
- On the
Application Files tab, click
Legacy application needs deploying; then click
Add Files to add the following files:
File
|
Project Folder
|
bookfile.dat
|
ProgramEJB
|
bookfile.idx
|
ProgramEJB
|
book.dll
|
ProgramEJB >
New_Configuration.bin
|
These files are copied to the
enterprise server instance when you deploy. The
.dat and
.idx files are the data and index parts of the indexed file accessed by the service. The
.dll is the executable file you need to debug the service.
- On the
EJB Generation tab, use the lists to set the
Application Server to
JEE 6 and
JBoss EAP 6.4.
- Uncheck
Transactional.
- In the
Java compiler field, type the location of your
javac.exe.
- Click
Browse that corresponds to the
Java EE Class Path field, and type following EJB connector class file paths, they are located in the following subfolders:
- jboss-eap-6.4\modules\system\layers\base\javax\resource\api\main\jboss-connector-api_1.6_spec-1.0.1.Final-redhat-3.jar
- jboss-eap-6.4\modules\system\layers\base\javax\ejb\api\main\jboss-ejb-api_3.1_spec-1.0.2.Final-redhat-3.jar
- jboss-eap-6.4\modules\system\layers\base\javax\servlet\api\main\jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-2.jar
In addition, add the
javac.exe from your Java installation
bin folder.
- Click
OK.
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 as follows:
- If the Server Explorer in
Visual COBOL is not active, click
Window > Show View > Other > Micro Focus > Server Explorer; then click
OK.
- From the Server Explorer, expand
Local [localhost:86]
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. 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 ProgramEJB service will run.
- If the Server Explorer in
Visual COBOL is not active, click
Window > Show View > Other > Micro Focus > Server Explorer; then click
OK.
- From the Server Explorer, expand
Local [localhost:86]
to see a list of available
enterprise server instances.
- 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.
- If a sign-on dialog box appears, click
OK; then click
No to disable password recovery.
The
Enterprise Server Daemon is then invoked via the Console, starting the
enterprise server instance.
Deploy the ProgramEJB
Java interface
- From
COBOL Explorer, right-click the
ProgramEJB
Java interface; then click
Deploy.
- In Eclipse, click the
Console tab.
- On the icon bar, click the down arrow associated with
Display Selected Console
.
- 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, you can look at the details of the deployed
service Enterprise Server Administration page.
- If you have closed
Enterprise Server Administration, start it again from the from the Server Explorer.
In the row showing information for the ESDEMO enterprise server, you should see that the
Objects column shows the number of services that this enterprise server runs. In this case, the number of running services should
be at least 9. 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.
- Click the
Details button for the ESDEMO Services.
In the row showing your new service,
ProgramEJB, you see that the
Current Status column shows all four operations as
Available. This means that the service is ready to be access by a client.