I am using Proleap Cobol Parser and at run time it is automatically taking antlr runtime 13 which is not able to deserialize the Adaptive Transition Network (java.io.InvalidClassException: .antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).)
The version of Proleap Cobol Parser is 4.7.2 that is currently available at . But when I am using the below dependency management to downgrade my antlr4-runtime version to 4.7.2, some of the methods just simply become unreachable, i.e. not supported.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7.2</version> <!-- Force the correct version -->
<scope>runtime</scope>
</dependency>
</dependencies>
</dependencyManagement>`
I just want the correct the version combo of antlr4-runtime and Proleap Cobol Parser.
I am using Proleap Cobol Parser and at run time it is automatically taking antlr runtime 13 which is not able to deserialize the Adaptive Transition Network (java.io.InvalidClassException: .antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).)
The version of Proleap Cobol Parser is 4.7.2 that is currently available at https://github/uwol/proleap-cobol-parser. But when I am using the below dependency management to downgrade my antlr4-runtime version to 4.7.2, some of the methods just simply become unreachable, i.e. not supported.
<dependencyManagement>
<dependencies>
<dependency>
<groupId>.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7.2</version> <!-- Force the correct version -->
<scope>runtime</scope>
</dependency>
</dependencies>
</dependencyManagement>`
I just want the correct the version combo of antlr4-runtime and Proleap Cobol Parser.
Share Improve this question edited Jan 29 at 14:32 Simon Sobisch 7,3821 gold badge20 silver badges40 bronze badges asked Jan 29 at 11:32 Ashish GuptaAshish Gupta 1 3- Either downgrade your own code, or fork the Proleap Cobol Parser and upgrade it. – Bart Kiers Commented Jan 29 at 18:04
- "I am using the below dependency management to downgrade my antlr4-runtime version to 4.7.2" What version of ANTLR is your code actually using? It seems that you are showing only a part of the problem. Does your application build requires a newer version of ANTLR? Share a full minimal reproducible example. – aled Commented Jan 31 at 12:46
- Also, what is ANTLR runtime 13? That doesn't look like a valid version for ANTLR. – aled Commented Jan 31 at 12:50
1 Answer
Reset to default 0What worked for me,
cloned the proleap repository
having java and ANTRL4 runtime jar in path
moved to path
...\src\main\antlr4\io\proleap\cobol
e.g. directory containing the two grammersin this directory executed
java .antlr.v4.Tool -package io.proleap.cobol -visitor Cobol.g4
java .antlr.v4.Tool -package io.proleap.cobol -visitor CobolPreprocessor.g4
This generates listeners and vistors and adds package needed.copied all generated files but the two grammers to
...\src\main\java\io\proleap\cobol
used Java 21 (selected in IntelliJ)
used latest ANTLR4 by setting in
pom.xml
<antlr.version>4.13.2<antlr.version>
project compiled error free
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745301554a4621464.html
评论列表(0条)