This chapter describes how to deploy service interfaces from a .car file for use in a production environment and how to deploy EJBs and resource adapters for EJB service interfaces.
Before you can run a service interface that has been generated using the Interface Mapping Toolkit, it needs to be deployed to an enterprise server. The service interface comprises the mapping information and might include the COBOL program and any required data.
During development the developer usually deploys the interface automatically using the Deploy tool in the Interface Mapping Toolkit. Once it is ready for use in a production environment however, you should deploy it using the .car file that was produced when the Deploy tool was run for the last time.
There are two methods of deploying the .car file:
The mfdepinst command handles the server-side part of the process of deploying a service to enterprise server. The tool installs the services contained in a .car onto the enterprise server. It is the equivalent of unpacking the .car file manually and adding the files using Enterprise Server Administration as described in the section Deploying the .car File Manually.
The mfdepinst command extracts the files (.int .idt and so on) from the .car file, updates the Directory Service directory for the new services and packages, and if the enterprise server is running tells it about the new services so they're available for use.
For full details see the topic mfdepinst.
You can also deploy manually, by unpacking the files in the COBOL archive file .car for your service and adding these to enterprise server, using Enterprise Server Administration. The .car file is created when the Deploy tool is used.
The .car file is in your deployment folder myservice\Repos\ myservice.deploy. The significant files in the COBOL archive are:
To deploy the service interface manually, you use Enterprise Server Administration to:
An EJB running a COBOL service runs in two places: the COBOL service runs under an enterprise server, and the EJB and client run under a third party J2EE application server, such as WebSphere or WebLogic.
You deploy the COBOL service from the .car file (or, if you are a developer, by using the Deploy tool in the Interface Mapping Toolkit). See the section Service Interfaces.
You deploy the EJB and client by deploying the following to a J2EE application server:
If you haven't generated an .ear file, but have only the .jar file, you might be able to deploy the .jar file instead. Your J2EE application might require you to package the .jar file into an .ear before deploying it, or you might find it simpler to do that.
Many J2EE application servers are supported, such as BEA WebLogic and IBM WebSphere. Each application server has different deployment requirements and different utilities to help. For details of the supported application servers see Third Party Software.
You can bypass the J2EE application server in two ways, by:
The Micro Focus resource adapters enable EJBs deployed on J2EE to communicate with COBOL on an enterprise server. Resource adapters are also known loosely as J2EE connectors.
Before an EJB can communicate with the COBOL code running on Micro Focus Server, you need to:
You must deploy a resource adapter appropriate to your application server and the J2EE version it uses. The following resource adapters are supplied for each supported application server and J2EE version:
The information needed to deploy the resource adapters is set up in deployment descriptors. Different deployment descriptors are supplied for each application server. You can view the deployment descriptors in a text editor. For example, the deployment descriptor weblogic-ra.xml, which is in the archive file mfcobol-notx.rar, contains the following lines:
<connection-factory-name>CCIMFCobol_xxx</connection-factory-name> <jndi-name>eis/MFCobol_xxx</jndi-name>
Where xxx is 1.0 for j2ee13 and 1.5 for j2ee14.
Deployment descriptors are xml files that describe the component to be deployed. J2EE application servers require deployment descriptors for the archive files (.jar, .war and .ear) to be deployed. At run time, the application server reads the descriptors and acts accordingly.
When you generate an EJB or client, generic deployment descriptors are created and packaged into the relevant archive files. Some J2EE application servers require additional deployment descriptors and these are generated automatically for the supported application servers.
For more information see the section Deployment Descriptors in the chapter Mapping a Java Interface and Using Resource Adapters in your Java and COBOL book, which is supplied with your COBOL development system.
Support for the CustomRecord and the RuntimeProperties interfaces is provided in mfejblib.jar for EJBs and in mfj2se.jar for J2SE Java beans.
For J2SE Java beans, you need to make sure that the mfj2se.jar is available to the Java run-time system and is on the Java classpath.
For EJBs, this support is automatically included in the application .ear file when you generate a client for the EJB. If you create a client manually, you need to add the mfejblib.jar to your .ear file, manually. Specific versions of this file are supplied for each supported application server and J2EE version.
Deploying EJBs involves configuring them in the third party application server on the J2EE machine, so that the EJBs, resource adapter and Enterprise Server can locate each other.
When you deploy an EJB you use the interface for your third-party application server. Many application servers provide a Web-based interface, such as the WebLogic Server Console, which takes you step by step through the deployment process. Most third-party application servers require the EJB to be packaged in an application .ear file, together with the client and all the necesssary deployment descriptors and other files. This .ear file is generated automatically when you generate a client using the Interface Mapping Toolkit.
If you don't have an application .ear file, you can often use your application server's administration interface to create one, or you can use the jar command.
Several third party application servers are supported for use during development and in production. For example WebSphere and WebLogic. For details of the supported application servers see Third Party Software.
Most third party application servers come with a Web-based administration console, which you use to deploy EJB and resource adapters. These take you step by step through deployment and provide information online.
When you have changed the modules deployed on the server, we recommend that you stop and restart the server.
If your deployed EJB does not work, check the following things:
Copyright © 2008 Micro Focus (IP) Ltd. All rights reserved.