epsilon.emf.loadRegisteredMetamodel has no effect in Antrunner [message #1850123] |
Thu, 17 February 2022 05:13 |
|
I am trying to run a transformation toolchain in antrunner. It is intended to transform a WSDL instamce to a RAML instance. It runs ok in a local eclipse epsilon instance with WST installed, from the UI but fails when run with the same instance using antrunner.
The WSDL instance transitively depends on the SOAP metamodel.
If I include the metamodeluri parameter in the loadmodel clause, the elements directly instanciating WSDL metaclasses are loaded. However, the transform fails to find elements based on SOAP. Note that the build completes and the failure is provided as a throw afterwards.
I have tried to force the second metamodel by using loadRegisteredMetamodel as seen below. This call seems to have no effect at all in the CI. without the direct metamodeluri argument the WSDL metamodel also is not found.
Is there any other way I can get these metamodels to load to bypass this issue?
I would assume that this is a plugin lazy loading problem of some kind.
<target name="default" description="description">
<epsilon.emf.loadModel failonerrors="true" failonwarnings="true" name="WSDL" modelfile="WSDL/TLD4_WSDL.wsdl" metamodeluri="http://www.eclipse.org/wsdl/2003/WSDL" />
<epsilon.emf.loadModel failonerrors="true" failonwarnings="true" name="RAML" modelfile="out.xmi" read="false" store="true" metamodelfile="test.ecore" />
<epsilon.etl failonerrors="true" failonwarnings="true" src="test.etl">
<model ref="WSDL" />
<model ref="RAML" />
</epsilon.etl>
</target>
<target name="default" description="description">
<epsilon.emf.loadRegisteredMetamodel failonerrors="true" failonwarnings="true" metamodeluri="http://www.eclipse.org/wsdl/2003/SOAP"/>
<epsilon.emf.loadRegisteredMetamodel failonerrors="true" failonwarnings="true" metamodeluri="http://www.eclipse.org/wsdl/2003/WSDL"/>
<epsilon.emf.loadModel failonerrors="true" failonwarnings="true" name="WSDL" modelfile="WSDL/TLD4_WSDL.wsdl" />
<epsilon.emf.register failonerrors="true" failonwarnings="true" file="test.ecore"/>
<epsilon.emf.loadModel failonerrors="true" failonwarnings="true" name="RAML" modelfile="out.xmi" read="false" store="true" />
<epsilon.etl failonerrors="true" failonwarnings="true" src="test.etl" >
<model ref="WSDL" />
<model ref="RAML" />
</epsilon.etl>
</target>
[Updated on: Thu, 17 February 2022 05:40] Report message to a moderator
|
|
|
Re: epsilon.emf.loadRegisteredMetamodel has no effect in Antrunner [message #1850124 is a reply to message #1850123] |
Thu, 17 February 2022 05:15 |
|
Cannot find meta-class 'Definition' in model 'WSDL'
at org.eclipse.epsilon.emc.emf.AbstractEmfModel.classForName(AbstractEmfModel.java:231)
at org.eclipse.epsilon.emc.emf.AbstractEmfModel.getCacheKeyForType(AbstractEmfModel.java:216)
at org.eclipse.epsilon.eol.models.CachedModel.removeFromCache(CachedModel.java:187)
at org.eclipse.epsilon.emc.emf.EmfModel.forceRemoveFromCache(EmfModel.java:331)
at org.eclipse.epsilon.emc.emf.EmfModel$CachedContentsAdapter.handle(EmfModel.java:256)
at org.eclipse.epsilon.emc.emf.EmfModel$CachedContentsAdapter.notifyChanged(EmfModel.java:199)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.dispatchNotification(NotifyingListImpl.java:261)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.clear(NotifyingListImpl.java:1099)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.doUnload(ResourceImpl.java:1699)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.unload(ResourceImpl.java:1721)
at org.eclipse.epsilon.emc.emf.CachedResourceSet$Cache.returnResource(CachedResourceSet.java:123)
at org.eclipse.epsilon.emc.emf.AbstractEmfModel.disposeModel(AbstractEmfModel.java:365)
at org.eclipse.epsilon.eol.models.CachedModel.dispose(CachedModel.java:312)
at org.eclipse.epsilon.eol.models.ModelRepository.dispose(ModelRepository.java:195)
at org.eclipse.epsilon.workflow.tasks.ShutdownProjectRepositoryListener.buildFinished(ShutdownProjectRepositoryListener.java:42)
at org.apache.tools.ant.Project.fireBuildFinished(Project.java:2111)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.fireBuildFinished(InternalAntRunner.java:875)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:742)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:573)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.ant.core.AntRunner.run(AntRunner.java:506)
at org.eclipse.ant.core.AntRunner.start(AntRunner.java:603)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
|
|
|
|
Re: epsilon.emf.loadRegisteredMetamodel has no effect in Antrunner [message #1850129 is a reply to message #1850126] |
Thu, 17 February 2022 07:46 |
|
Hi Jörn,
Does it work any better if you specify the URIs of the metamodels the WSDL model conforms to, separated by comma, as follows?
<epsilon.emf.loadModel name="WSDL" ... metamodeluri="http://www.eclipse.org/wsdl/2003/SOAP, http://www.eclipse.org/wsdl/2003/WSDL" .../>
The purpose of loadRegisteredMetamodel is to load registered metamodels as EMF models so that they can be queried by an Epsilon program, so calling it in this case shouldn't make a difference.
Best,
Dimitris
[Updated on: Thu, 17 February 2022 11:23] Report message to a moderator
|
|
|
Re: epsilon.emf.loadRegisteredMetamodel has no effect in Antrunner [message #1850145 is a reply to message #1850129] |
Thu, 17 February 2022 23:13 |
|
Wonderful. That works, but only if the MMs are comma-separated without a space. With the space, you get another exception.
I was mislead by the singular in the name of the attribute. seemed to suggest just that you can add just a single one. And since you cannot have an attribute multiply defined and there were no nested elements available, I gave up on that idea and looked for another way to do it. The seemed to suggest itself as I was sure that the metamodels were
- registered in the Eclipse extension registry
- not previously loaded in the workflow
So, given that Eclipse lazy-loads, this seemed to be the way to wake up those metamodels.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03422 seconds