uwol / proleap-cobol

ProLeap COBOL • Analyze, Execute & Transform COBOL
GNU Affero General Public License v3.0
23 stars 5 forks source link

CompilationUnit.getProgramUnit()" is null #6

Open pbaker01 opened 6 months ago

pbaker01 commented 6 months ago

ProLeap Exception.pdf

I have downloaded and configured both the ProLeap COBOL Parser and ProLeap COBOL projects. I have also added the Windows ENVT variables for SMTP mail. I've been testing the jetty endpoints and I am having issues with the /v1/cobol/analyze/text endpoint.

My json request looks like:

{
    "code": "d:/temp/example.cbl",
    "format": "FIXED"
}

The output I receive is:

Cannot invoke "io.proleap.cobol.asg.metamodel.ProgramUnit.getProcedureDivision()" because the return value of "io.proleap.cobol.asg.metamodel.CompilationUnit.getProgramUnit()" is null

PDF of email received is attached.

The program, located at: d:/temp/example.cbl is:

000100 Identification Division.
000200 Program-ID. 
000300  HELLOWORLD.
000400 Procedure Division.
000500  DISPLAY 'a' UPON CONSOLE.
000600  STOP RUN.

I use postman to submit my requests. Before issuing a request to the analyze endpoint I first issue an /up request followed by a /cron/warmup request.

What am I doing wrong?

Note: I had previously changed: /proleap-cobol-parser/src/main/java/io/proleap/cobol/preprocessor/CobolPreprocessor.java

NEWLINE constant changed to System.lineSeparator()

    //PB final static String NEWLINE = "\n";
    final static String NEWLINE = System.lineSeparator();

Paul

pbaker01 commented 6 months ago

Plz close. code tag is not the location of the code but the code itself.. :)