Community
Participate
Working Groups
Hi, Our non-reg JUnit tests on MoDisco project (Indigo nighlty build) encounters some regression with recent ATL libraries (org.Eclipse.m2m.atl 3.2.0.v20110201-0921). Our test calls the ATLParser.parseToModel service. The test code has not changed recently but encounters now the following error : java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ... at org.eclipse.m2m.atl.dsls.tcs.injector.wrappers.antlr3.ParserWrapper.parse(ParserWrapper.java:85) ... at org.eclipse.m2m.atl.engine.parser.AtlParser.parseToModel(AtlParser.java:258) Caused by: java.lang.NoSuchFieldError: ruleMemo at org.eclipse.m2m.atl.dsls.tcs.injector.ATL_ANTLR3Lexer.<init>(ATL_ANTLR3Lexer.java:148)
Created attachment 189185 [details] Stack trace
The issue does not occur anymore. Mark the bug as resolved.
The problem is happening again with 3.7M6 and with MoDisco (which depends on ATL). ATL appears to be incompatible with the latest version of Antlr (3.2.0). It works only with Antlr 3.0.0. In our installations, we can see two versions of Antlr: org.antlr.runtime_3.0.0.v200803061811 org.antlr.runtime_3.2.0.v201101311130 But at runtime, ATL uses version 3.2.0, which leads to this "NoSuchFieldError: ruleMemo" error. ATL uses version 3.2.0 because it does not specify a version range, so OSGi picks the latest available version, which is 3.2.0. In the Manifest.MF of org.eclipse.m2m.atl.dsls, I see: Require-Bundle: [...],org.antlr.runtime;visibility:=reexport,[...] I propose to replace it with: Require-Bundle: [...],org.antlr.runtime;bundle-version="[3.0.0,3.1.0)";visibility:=reexport,[...] With this change, org.eclipse.m2m.atl.dsls compiles in my workspace with both org.antlr.runtime 3.0.0 and 3.2.0 installed. Eclipse SDK Version: 3.7.0 Build id: I20110310-1119 org.eclipse.m2m.atl.sdk.feature.group 3.2.0.v20110315-0927
I changed the manifest.mf in the latest build (http://www.eclipse.org/modeling/download.php?file=/modeling/m2m/atl/downloads/drops/3.2.0/S201105020337/m2m-atl-Update-3.2.0M7.zip). Thanks for reporting it !