#10 cb2xml.properties

v1.0_(example)
open
Bruce Martin
4
2015-01-04
2014-03-31
Anonymous
No

Hi Bruce, I installed JRecord and try to compile the example given for read a Cobol file, but it appears to have some problem finding the cb2xml.properties file. Here's the Exception log:

            Properties File: /C:/Program%20Files/JRecord/jars/JRecord.properties false
            java.io.FileNotFoundException: cb2xml.properties (El sistema no puede encontrar el archivo especificado)
                at java.io.FileInputStream.open(Native Method)
                at java.io.FileInputStream.<init>(Unknown Source)
                at java.io.FileInputStream.<init>(Unknown Source)
                at net.sf.cb2xml.CobolPreprocessor.preProcess(Unknown Source)
                at net.sf.cb2xml.CobolPreprocessor.preProcess(Unknown Source)
                at net.sf.JRecord.External.Def.Cb2Xml.convert(Cb2Xml.java:102)
                at net.sf.JRecord.External.Def.Cb2Xml.convertToXMLDOM(Cb2Xml.java:72)
                at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:81)
                at net.sf.JRecord.IO.CobolIoProvider.getLineReader(CobolIoProvider.java:94)
                at net.sf.JRecord.IO.CobolIoProvider.getLineReader(CobolIoProvider.java:62)
                at Main.main(Main.java:26)
            *** using start column = 6, end column = 72
            net.sf.cb2xml.sablecc.parser.ParserException: [1,1] expecting: number88, number not88
                at net.sf.cb2xml.sablecc.parser.Parser.parse(Unknown Source)
                at net.sf.JRecord.External.Def.Cb2Xml.convert(Cb2Xml.java:112)
                at net.sf.JRecord.External.Def.Cb2Xml.convertToXMLDOM(Cb2Xml.java:72)
                at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:81)
                at net.sf.JRecord.IO.CobolIoProvider.getLineReader(CobolIoProvider.java:94)
                at net.sf.JRecord.IO.CobolIoProvider.getLineReader(CobolIoProvider.java:62)
                at Main.main(Main.java:26)
            java.lang.NullPointerException
                at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:92)
                at net.sf.JRecord.IO.CobolIoProvider.getLineReader(CobolIoProvider.java:94)
                at net.sf.JRecord.IO.CobolIoProvider.getLineReader(CobolIoProvider.java:62)
                at Main.main(Main.java:26)

Discussion

  • Bruce Martin
    Bruce Martin
    2014-03-31

    The cb2xml.properties message is a warning rather than error, cb2xml will default to use columns 6 to 72 indicated by:

    *** using start column = 6, end column = 72

    You could create an empty cb2xml.properties file if you want

    The critical error is in

    net.sf.cb2xml.sablecc.parser.ParserException: [1,1] expecting: number88, number not88
                at net.sf.cb2xml.sablecc.parser.Parser.parse(Unknown Source)
                at net.sf.JRecord.External.Def.Cb2Xml.convert(Cb2Xml.java:112)
                at net.sf.JRecord.External.Def.Cb2Xml.convertToXMLDOM(Cb2Xml.java:72)
                at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:81)
                at net.sf.JRecord.IO.CobolIoProvider.getLineReader(CobolIoProvider.java:94)
                at net.sf.JRecord.IO.CobolIoProvider.getLineReader(CobolIoProvider.java:62)
                at Main.main(Main.java:26)
    

    indicating the parse found something unexpected at the start of the Cobol Copybook.

     

  • Anonymous
    2015-01-04

    I am getting the same (or a similar) error. Is there a way to tell from the .ParserException line where the error in the copybook is?

    Here is my Error:

    using start column = 6, end column = 72
    fatal parse error ***
    [1,12] expecting: '.'
    Exception in thread "main" java.lang.NullPointerException
    at net.sf.JRecord.External.CobolCopybookLoader.loadCopyBook(CobolCopybookLoader.java:146)
    at tsys.terms.main(terms.java:86)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)

     
  • Bruce Martin
    Bruce Martin
    2015-01-04

    The error line/column is in

        [1,12] expecting: '.'
    

    The error is in (or before) line 1 column 12


    Also make sure there are no tabs in the copybook (first 7 chars of the line). Some editors stick them in, They cause unexpected errors in cb2xml.

     
    Last edit: Bruce Martin 2015-01-04


Anonymous


Cancel   Add attachments