Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems when running MWE2 with exec-maven-plugin due to non consistent EMF dependencies #3304

Open
LorenzoBettini opened this issue Dec 18, 2024 · 0 comments

Comments

@LorenzoBettini
Copy link
Contributor

In my DSL https://github.com/LorenzoBettini/edelta when switching to Xtext 2.37.0 and 2024-12, the MWE2 workflow executed through exec-maven-plugin I get this failure:

2178 [org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main()] ERROR mf.mwe2.launch.runtime.Mwe2Launcher  - 'java.net.URL org.eclipse.emf.common.util.CommonUtil.newURL(java.lang.String)'
java.lang.NoSuchMethodError: 'java.net.URL org.eclipse.emf.common.util.CommonUtil.newURL(java.lang.String)'
	at org.eclipse.emf.codegen.jet.JETCompiler.openStream(JETCompiler.java:1442)
	at org.eclipse.emf.codegen.jet.JETCompiler.findLocation(JETCompiler.java:1372)
	at org.eclipse.emf.codegen.jet.JETCompiler.findLocation(JETCompiler.java:1348)
	at org.eclipse.emf.codegen.jet.JETCompiler.find(JETCompiler.java:1417)
	at org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGeneratorAdapterFactory.getMergeRulesURI(GenModelGeneratorAdapterFactory.java:263)
	at org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGeneratorAdapterFactory.initializeMergeRulesURI(GenModelGeneratorAdapterFactory.java:195)
	at org.eclipse.emf.codegen.ecore.genmodel.generator.GenModelGeneratorAdapterFactory.initialize(GenModelGeneratorAdapterFactory.java:168)
	at org.eclipse.emf.codegen.ecore.generator.Generator.initialize(Generator.java:285)
	at org.eclipse.emf.codegen.ecore.generator.Generator.setInput(Generator.java:254)
	at org.eclipse.xtext.xtext.generator.ecore.EMFGeneratorFragment2.doGenerate(EMFGeneratorFragment2.java:1021)
	at org.eclipse.xtext.xtext.generator.ecore.EMFGeneratorFragment2.generate(EMFGeneratorFragment2.java:476)
	at org.eclipse.xtext.xtext.generator.CompositeGeneratorFragment2.generate(CompositeGeneratorFragment2.java:43)
	at org.eclipse.xtext.xtext.generator.XtextGenerator.invokeInternal(XtextGenerator.java:228)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:133)
	at org.eclipse.emf.mwe.core.lib.Mwe2Bridge.invoke(Mwe2Bridge.java:35)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:213)
	at org.eclipse.emf.mwe2.runtime.workflow.AbstractCompositeWorkflowComponent.invoke(AbstractCompositeWorkflowComponent.java:38)
	at org.eclipse.emf.mwe2.runtime.workflow.Workflow.run(Workflow.java:21)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:103)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:63)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:53)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:78)
	at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
	at org.codehaus.mojo.exec.ExecJavaMojo.doMain(ExecJavaMojo.java:385)
	at org.codehaus.mojo.exec.ExecJavaMojo.doExec(ExecJavaMojo.java:374)
	at org.codehaus.mojo.exec.ExecJavaMojo.lambda$execute$0(ExecJavaMojo.java:296)
	at java.base/java.lang.Thread.run(Thread.java:1583)

I still have to check whether using the new generator.dependencies bundle triggers the problem.

The root cause is that the JETCompiler uses a new method org.eclipse.emf.common.util.CommonUtil.newURL(java.lang.String), introduced in emf.common in 2.40, while our pinned version is 2.24.0. I guess that emf.codegen is a newer version, while emf.common is an old one...

I'll inspect further and see whether the generator.dependencies has to be updated accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant