Parser not usable with fm-model 1.0 due to ANTLR runtime error
Closed this issue · 1 comments
Hi, I'm currently trying to use the parser v0.3 and the metamodel v1.0 to parse and process UVL models.
Unfortunately as soon as I try to parse a feature model I receive an error from the antlr runtime which is as follows:
ANTLR Tool version 4.13.1 used for code generation does not match the current runtime version 4.9.3
ANTLR Runtime version 4.13.1 used for parser compilation does not match the current runtime version 4.9.3
!ENTRY com.ps.consul.eclipse.core 4 0 2024-01-31 11:32:22.234
!MESSAGE Error occurred
!STACK 0
java.lang.ExceptionInInitializerError
at de.vill.main.UVLModelFactory.parseFeatureModelWithImports(UVLModelFactory.java:324)
at de.vill.main.UVLModelFactory.parse(UVLModelFactory.java:131)
at de.vill.main.UVLModelFactory.parse(UVLModelFactory.java:119)
at at.jku.cps.uvlimport.util.ImportRunner.addDataToModel(ImportRunner.java:69)
at at.jku.cps.uvlimport.util.ImportRunner.run(ImportRunner.java:151)
at at.jku.cps.uvlimport.ui.ImportWizard$1.run(ImportWizard.java:105)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: java.lang.UnsupportedOperationException: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 4 (expected 3).
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:187)
at uvl.UVLJavaLexer.<clinit>(UVLJavaLexer.java:740)
... 7 more
Caused by: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 4 (expected 3).
... 9 more
!ENTRY org.eclipse.e4.ui.workbench.swt 1 0 2024-01-31 11:32:46.542
!MESSAGE Saving dialog settings
In this example I have tried the ANTLR toolchain version 4.9.3 because it was mentioned by people having a similar issue here.
If I try the change the version the the initially recommended version 4.13.1 I get the following errors:
ANTLR Tool version 4.9.3 used for code generation does not match the current runtime version 4.13.1
ANTLR Runtime version 4.9.3 used for parser compilation does not match the current runtime version 4.13.1
!ENTRY com.ps.consul.eclipse.core 4 0 2024-01-31 11:45:30.968
!MESSAGE Error occurred
!STACK 0
java.lang.ExceptionInInitializerError
at org.logicng.io.parsers.PseudoBooleanParser.<init>(PseudoBooleanParser.java:74)
at org.logicng.formulas.FormulaFactory.<init>(FormulaFactory.java:158)
at at.jku.cps.uvlimport.util.ImportHelper.addConstraints(ImportHelper.java:1169)
at at.jku.cps.uvlimport.util.ImportHelper.importModel(ImportHelper.java:110)
at at.jku.cps.uvlimport.util.ImportRunner.addDataToModel(ImportRunner.java:74)
at at.jku.cps.uvlimport.util.ImportRunner.run(ImportRunner.java:151)
at at.jku.cps.uvlimport.ui.ImportWizard$1.run(ImportWizard.java:105)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Caused by: java.lang.UnsupportedOperationException: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:56)
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:48)
at org.logicng.io.parsers.LogicNGPseudoBooleanLexer.<clinit>(LogicNGPseudoBooleanLexer.java:146)
... 8 more
Caused by: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).
... 11 more
What could be the issue here? I'm currently at my whits' end.
Thanks in advance!
I figured my problem out. I was using another dependency "logicng" to do some logic stuff. Unfortunately that was using antlr version 4.9.3 and depending on which runtime I was using either the uvl parser or logicng were crashing. Figured out there is a Java 11 branch of logicng which is also built on antlr 4.13.1, which thankfully works now.