Previous Topic Next topic Print topic


CustomRecord and Other Java Support

If your EJB or Java bean uses custom records you need to make sure that support for them is available. Custom records are created if you map COBOL group items onto Java data types. You map group items in the Interface Mapper whenever you set up Reusable Mappings for group items and you then make those group items into complex interface fields.

For Java beans, support for the CustomRecord and the RuntimeProperties interfaces is provided in mfj2se.jar, which is supplied in the ...\base\bin directory of your installation. This support must be available at run time, and you can ensure this by putting mfj2se.jar on the classpath. For example, you could run your application, with the command:.

java –classpath class-directory\mfj2se.jar myProgram.class

For EJBs, support for the CustomRecord and the RuntimeProperties interfaces is provided in mfejblib.jar. This support is automatically included in the application .ear file when you generate a client for the EJB. When the Deploy tool creates the EJB, it adds a manifest file manifest.mf to the .jar file, and in that manifest file it sets the classpath to mfejblib.jar.

If you create a client manually, you need to add the mfejblib.jar to your .ear file, manually. There are two versions of the file: one for J2EE 1.3 and one for J2EE 1.4, and these are available in the base\bin\j2ee13 and base\bin\j2ee14 directories. By default, the mfejblib.jar file belongs in the root of the .ear file, because the classpath to mfejblib.jar is set to the root in the manifest.mf file of the EJB's .jar file.

You can view this manifest file by extracting it from the EJB's archive file, myservice.jar, which is in myproject \Repos\.deploymyservice. Notice that the classpath is set as follows:

Class-path: mfejblib.jar

If you require mfejblib.jar to be elsewhere, you need to change the classpath in manifest.mf in the EJB's jar file accordingly.

Previous Topic Next topic Print topic