Error encountered while creating an XML schema file

Technote (troubleshooting)


Problem(Abstract)

Using the J2C->CICS/IMS Java Data Binding to generate the Java data binding bean from a COBOL copy book with the generation style of "Preserve case of names" results in a com.ibm.adapter.framework.BaseException.

The same issue occurs if you are using the J2C->J2C bean wizard with the generation style of "Preserve case of names."

Symptom

A com.ibm.adapter.framework.BaseException is thrown with the following message: Error encountered while creating XML schema file DFHCOMMAREA.xsd


Cause

The name of a field in the COBOL copy book begins with a numeric number, for example, 99MY_CUSTOMER

This is a snippet of the cobol copy book

05 CUSTOMER-TYPE PIC X(2).
88 99MY-CUSTOMER VALUE '99'.

When "preserve case of names" is used, the field name is preserved and used directly in the Java data binding bean code generation. A Java field is generated with the name 99MY-CUSTOMER, which is not valid Java syntax, so the field name is not acceptable.

This is working as designed.


Diagnosing the problem

When you go through the J2C->CICS/IMS Data binding wizard, using the Generation Style - Preserve case of names, you will seen an error dialog.

In the workspace log, you will see similar stack trace where the failure will list the field that has an issue which is 99MY-CUSTOMER


at com.ibm.etools.ctc.cobol2xsd.util.PropertyName.getPropertyNameList(Unknown Source)
at com.ibm.etools.ctc.cobol2xsd.typesimport.CobolElementVisitor.visitCOBOLComposedType(Unknown Source)
at com.ibm.etools.ctc.cobol2xsd.typesimport.CobolElementVisitor.visitCOBOLElement(Unknown Source)
at com.ibm.etools.ctc.cobol2xsd.typesimport.CobolElementVisitor.visit(Unknown Source)
at com.ibm.etools.ctc.cobol2xsd.typesimport.CobolElementVisitor.acceptItemVisitor(Unknown Source)
at com.ibm.etools.ctc.cobol2xsd.typesimport.CobolTypes2XSDCommand.visitTypes(Unknown Source)
at com.ibm.etools.ctc.cobol2xsd.typesimport.CobolTypes2XSDCommand.importTypes(Unknown Source)
at com.ibm.adapter.typesimport.impl.TypesImportCommand.createResource(Unknown Source)
... 56 more
!SUBENTRY 1 com.ibm.record.writer 4 4 2013-05-08 16:22:06.094
!MESSAGE Error encountered while creating XML schema file DFHCOMMAREA.xsd.
!STACK 1
com.ibm.adapter.framework.BaseException: 99MY-CUSTOMER

at com.ibm.etools.ctc.cobol2xsd.util.PropertyName.getPropertyNameList(Unknown Source)



Resolving the problem

There are two ways to work around the issue:

  1. You can use another Generation style e.g. "Default"
  2. Or you can correct the field in the copy book to begin with non-numeric character,
    for example, MY-CUSTOMER99.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational Application Developer for WebSphere Software
Java Connector Development

Software version:

8.0.4.1, 8.0.4.2, 8.5, 8.5.1

Operating system(s):

Windows

Reference #:

1636798

Modified date:

2013-05-13

Translate my page

Machine Translation

Content navigation