In some Spoofax languages, the language.jar and language-java.jar files are somehow incompatible after building once, you get an error like:

Internal error: strategy does not exist or is defined in a module that is not imported: Definition 'editor-analyze' not found
rewriting failed

The error log has more information in a preceding error, for example for the Green-Marl language:

Could not load compiler service provider(s): [include/green_marl-java.jar, include/green_marl.jar]

org.strategoxt.imp.runtime.dynamicloading.BadDescriptorException: Could not load compiler service provider(s): [include/green_marl-java.jar, include/green_marl.jar]
	at org.strategoxt.imp.runtime.services.StrategoObserver.reportLoadException(StrategoObserver.java:444)
	at org.strategoxt.imp.runtime.services.StrategoObserver.loadJars(StrategoObserver.java:433)
	at org.strategoxt.imp.runtime.services.StrategoObserver.initialize(StrategoObserver.java:357)
	at org.strategoxt.imp.runtime.services.StrategoObserver.getRuntime(StrategoObserver.java:863)
	at org.strategoxt.imp.runtime.services.StrategoObserverUpdateJob.analyze(StrategoObserverUpdateJob.java:29)
	at org.strategoxt.imp.runtime.services.StrategoAnalysisQueue$UpdateJob.run(StrategoAnalysisQueue.java:83)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: org.strategoxt.IncompatibleJarException: Incompatible Stratego jar: file:/var/folders/k1/qz7wxzpd5pj10qfd307d47j00000gn/T/green_marl.jar-8980532102308886632.jar (GreenMarl/strategies/Main)
	at org.strategoxt.HybridInterpreter.registerJar(HybridInterpreter.java:338)
	at org.strategoxt.HybridInterpreter.loadJars(HybridInterpreter.java:291)
	at org.strategoxt.imp.debug.core.str.launching.DebuggableHybridInterpreter.loadJars(DebuggableHybridInterpreter.java:107)
	at org.strategoxt.imp.runtime.services.StrategoObserver.loadJars(StrategoObserver.java:428)
	... 5 more
Caused by: java.lang.NoClassDefFoundError: GreenMarl/strategies/Main
	at trans.Main.init(Main.java:1159)
	at trans.InteropRegisterer.registerLazy15(InteropRegisterer.java:1032)
	at trans.InteropRegisterer.registerLazy(InteropRegisterer.java:834)
	at trans.InteropRegisterer.registerLazy(InteropRegisterer.java:28)
	at org.strategoxt.HybridInterpreter.registerJar(HybridInterpreter.java:321)
	... 8 more
Caused by: java.lang.ClassNotFoundException: GreenMarl.strategies.Main
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	... 13 more

If the project is built again, it works fine.

Submitted by Gabriël Konat on 10 July 2013 at 23:53

On 10 July 2013 at 23:54 Gabriël Konat tagged 1.2

On 11 July 2013 at 00:24 Vlad Vergu commented:

In fact these Jars are completely empty after the first build.


On 13 July 2013 at 01:53 Gabriël Konat tagged major

On 13 July 2013 at 01:53 Gabriël Konat tagged build

On 13 March 2014 at 08:53 Eelco Visser removed tag 1.2

Log in to post comments