antlr version

64 views
Skip to first unread message

Pavel Tavoda

unread,
May 14, 2013, 9:10:12 AM5/14/13
to fornax-...@googlegroups.com
I started to use 3.0 generator for normal projects. One of our projects is using antlr version 3.0. When I add dependency to pom.xml:
<dependency>
<groupId>org.antlr</groupId>
  <artifactId>antlr-runtime</artifactId>
<version>3.0.1</version>
</dependency>

MWE plugin crash because it's compiled with version 3.2 of antlr. Do we have to start it in FORK mode?

Pavel

[INFO] --- fornax-oaw-m2-plugin:3.4.0:run-workflow (default) @ albiq-service ---
[INFO] Fornax Model Workflow Maven2 Plugin V3.4.0
[INFO] Forced workflow execution.
[INFO] Executing workflow in forked mode.
[ERROR] 14:50:48.771 [main] ERROR o.e.e.m.launch.runtime.Mwe2Launcher - org/antlr/runtime/RecognizerSharedState
[INFO] java.lang.NoClassDefFoundError: org/antlr/runtime/RecognizerSharedState
[ERROR] at java.lang.Class.getDeclaredConstructors0(Native Method) ~[na:1.6.0_45]
[ERROR] at java.lang.Class.privateGetDeclaredConstructors(Class.java:2398) ~[na:1.6.0_45]
[ERROR] at java.lang.Class.getDeclaredConstructors(Class.java:1838) ~[na:1.6.0_45]
[ERROR] at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:243) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:96) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:629) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:845) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:772) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:256) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:205) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.InjectorImpl.getInternalFactory(InjectorImpl.java:853) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.FactoryProxy.notify(FactoryProxy.java:46) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.ProcessedBindingData.runCreationListeners(ProcessedBindingData.java:50) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:133) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.Guice.createInjector(Guice.java:95) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.Guice.createInjector(Guice.java:72) ~[guice-3.0.jar:na]
[ERROR] at com.google.inject.Guice.createInjector(Guice.java:62) ~[guice-3.0.jar:na]
[ERROR] at org.eclipse.emf.mwe2.language.Mwe2StandaloneSetupGenerated.createInjector(Mwe2StandaloneSetupGenerated.java:34) ~[sculptor-generator-library-3.0.0-SNAPSHOT.jar:na]
[ERROR] at org.eclipse.emf.mwe2.language.Mwe2StandaloneSetupGenerated.createInjectorAndDoEMFRegistration(Mwe2StandaloneSetupGenerated.java:28) ~[sculptor-generator-library-3.0.0-SNAPSHOT.jar:na]
[ERROR] at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:71) ~[sculptor-generator-library-3.0.0-SNAPSHOT.jar:na]
[ERROR] at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35) ~[sculptor-generator-library-3.0.0-SNAPSHOT.jar:na]
[INFO] Caused by: java.lang.ClassNotFoundException: org.antlr.runtime.RecognizerSharedState
[ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:202) ~[na:1.6.0_45]
[ERROR] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_45]
[ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:190) ~[na:1.6.0_45]
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:306) ~[na:1.6.0_45]
[ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) ~[na:1.6.0_45]
[ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ~[na:1.6.0_45]
[INFO] ... 22 common frames omitted
[ERROR] ExitStatusException occurred while running workflow: Java returned: 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Torsten Juergeleit

unread,
May 14, 2013, 3:42:13 PM5/14/13
to fornax-...@googlegroups.com
Do we have to start it in FORK mode?

The Fornax OAW Maven plugin does start the MWE2 workflow in fork mode by default. This is necessary due to MEW2s approach of creating its classpath from the JVMs system classpath (system property "java.class.path").

The OAW plugin uses the dependencies of the Maven project (in addition to its own dependencies). Using the Maven projects dependencies for running MEW2 and Xtext with different requirements regarding dependencies (e.g. Google collections / guava) leads to this kind of issues.

Therefore I implemented a sculptor-specific Maven plugin. This plugin is only using the dependencies specified for the plugins (e.g. via the plugins own POM or in the projects POM). The projects own dependencies are not used by the plugin.

Maybe you can give this plugin a try.


The Maven plugin of Sculptor 3.0 will not fork a new java process. Here the MWE2 workflow is executed within the plugins thread / classloader.

/Torsten

Pavel Tavoda

unread,
May 15, 2013, 3:31:10 AM5/15/13
to fornax-...@googlegroups.com
That's interesting, didn't notice that. Should we switch it as default plugin for projects (use it in artifact)? Or it needs some better testing?

Pavel

Torsten Juergeleit

unread,
May 15, 2013, 6:40:57 AM5/15/13
to fornax-...@googlegroups.com
Should we switch it as default plugin for projects (use it in artifact)?

Yes, it would make sense to use this plugin in Sculptors Maven archetypes instead of the Fornax one.



Or it needs some better testing?

It seems that this plugin is used only by a single entity (the development team I'm working with during my day job :-).
So the plugin works but it needs more testing in different environments.

/Torsten
Reply all
Reply to author
Forward
0 new messages