Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Ant task problem
[ATL] Ant task problem [message #484844] Wed, 09 September 2009 09:51 Go to next message
Eclipse User
Originally posted by: monimambou-atl.yahoo.fr

Hi,
I've found nothing a bout ATL ant tasks, I therefore I my question.
I'm trrying to launch an ATL transformation with ant. A part of my ant
script can be found hereafter.
============================================================ ==========
<project>
<path id="pluginsclasspath">
<pathelement location="${basedir}/lib/atlAntTasks.jar"/>
<fileset dir="C:/sfo/tools/ganymede/plugins" includes="**/*.jar"/>
</path>
<property name="atl.launcher" value="EMF-specific VM" />
<taskdef name="atl.loadModel"
classname="org.eclipse.m2m.atl.core.ant.tasks.LoadModelTask ">
<classpath>
<path refid="pluginsclasspath"/>
</classpath>
</taskdef>
<atl.loadModel name="UML" metamodel="MOF"
nsURI="http://www.eclipse.org/uml2/2.1.0/UML" />
</project>
============================================================ =============

On runnuing that script, I get the following error message :

============================================================ =============
org.eclipse.m2m.atl.core.ATLCoreException:
org.eclipse.m2m.atl.core.launcher EMF-specific VM not found, check the
spelling or register it manually.
============================================================ =============

The detailed exception follows :
C:\sfo\work\svnspace\PMETAMODEL-TRANS\build.xml:30: Unable to load
launcher EMF-specific VM
at ...
org.eclipse.m2m.atl.core.ATLCoreException:
org.eclipse.m2m.atl.core.launcher EMF-specific VM not found, check the
spelling or register it manually
at
org.eclipse.m2m.atl.core.service.CoreService.getExtensionCla ss(CoreService.java:148)
at
org.eclipse.m2m.atl.core.service.CoreService.getLauncher(Cor eService.java:186)
at
org.eclipse.m2m.atl.core.ant.tasks.AbstractAtlTask.getLaunch er(AbstractAtlTask.java:131)
at
org.eclipse.m2m.atl.core.ant.tasks.AbstractAtlTask.getDefaul tModelFactory(AbstractAtlTask.java:148)
at
org.eclipse.m2m.atl.core.ant.tasks.LoadModelTask.execute(Loa dModelTask.java:110)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelp er2.java:142)
at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectH elper.java:93)
at org.apache.tools.ant.Main.runBuild(Main.java:743)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

============================================================ ====
I finally understood that
org.eclipse.m2m.atl.core.service.CoreService.getExtensionCla ss failed to
retrieve the name of the class related to the extension point
org.eclipse.m2m.core.atl.launcher. What seems really strange is that
everything works well within Eclipse with the same class CoreService,
which means that the way it raeds information from Eclipse plugin registry
is OK. I wondered whether everything necessary could be found into my
class path. I therefor put all the jars of my eclipse plugins directory in
the classpath, but I still have the error. I really don't see what I
should check, If someone has an idea.
I use atl 3.0 and eclipse ganymede.
Regards,
Stephane
Re: [ATL] Ant task problem [message #484912 is a reply to message #484844] Wed, 09 September 2009 12:30 Go to previous messageGo to next message
William Piers is currently offline William Piers
Messages: 297
Registered: July 2009
Senior Member
Hello,

A documentation about ATL ant tasks can be found here:
http://wiki.eclipse.org/ATL/User_Guide#ATL_ant_tasks

Do not forget to modify the launch configuration as specified here:
http://wiki.eclipse.org/ATL/User_Guide#Launching_an_Ant_file _with_ATL_tasks_in_an_Eclipse_workbench
before launching.

Best regards,

William

stephane a écrit :
> Hi,
> I've found nothing a bout ATL ant tasks, I therefore I my question. I'm
> trrying to launch an ATL transformation with ant. A part of my ant
> script can be found hereafter.
> ============================================================ ==========
> <project>
> <path id="pluginsclasspath">
> <pathelement location="${basedir}/lib/atlAntTasks.jar"/>
> <fileset dir="C:/sfo/tools/ganymede/plugins" includes="**/*.jar"/>
> </path>
> <property name="atl.launcher" value="EMF-specific VM" />
> <taskdef name="atl.loadModel"
> classname="org.eclipse.m2m.atl.core.ant.tasks.LoadModelTask ">
> <classpath>
> <path refid="pluginsclasspath"/>
> </classpath>
> </taskdef>
> <atl.loadModel name="UML" metamodel="MOF"
> nsURI="http://www.eclipse.org/uml2/2.1.0/UML" />
> </project>
> ============================================================ =============
>
> On runnuing that script, I get the following error message :
> ============================================================ =============
> org.eclipse.m2m.atl.core.ATLCoreException:
> org.eclipse.m2m.atl.core.launcher EMF-specific VM not found, check the
> spelling or register it manually.
> ============================================================ =============
>
> The detailed exception follows :
> C:\sfo\work\svnspace\PMETAMODEL-TRANS\build.xml:30: Unable to load
> launcher EMF-specific VM
> at ...
> org.eclipse.m2m.atl.core.ATLCoreException:
> org.eclipse.m2m.atl.core.launcher EMF-specific VM not found, check the
> spelling or register it manually
> at
> org.eclipse.m2m.atl.core.service.CoreService.getExtensionCla ss(CoreService.java:148)
>
> at
> org.eclipse.m2m.atl.core.service.CoreService.getLauncher(Cor eService.java:186)
>
> at
> org.eclipse.m2m.atl.core.ant.tasks.AbstractAtlTask.getLaunch er(AbstractAtlTask.java:131)
>
> at
> org.eclipse.m2m.atl.core.ant.tasks.AbstractAtlTask.getDefaul tModelFactory(AbstractAtlTask.java:148)
>
> at
> org.eclipse.m2m.atl.core.ant.tasks.LoadModelTask.execute(Loa dModelTask.java:110)
>
> at org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:106)
> at org.apache.tools.ant.Task.perform(Task.java:348)
> at org.apache.tools.ant.Target.execute(Target.java:357)
> at
> org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelp er2.java:142)
> at
> org.apache.tools.ant.ProjectHelper.configureProject(ProjectH elper.java:93)
> at org.apache.tools.ant.Main.runBuild(Main.java:743)
> at org.apache.tools.ant.Main.startAnt(Main.java:217)
> at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
> at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
>
> ============================================================ ====
> I finally understood that
> org.eclipse.m2m.atl.core.service.CoreService.getExtensionCla ss failed to
> retrieve the name of the class related to the extension point
> org.eclipse.m2m.core.atl.launcher. What seems really strange is that
> everything works well within Eclipse with the same class CoreService,
> which means that the way it raeds information from Eclipse plugin
> registry is OK. I wondered whether everything necessary could be found
> into my class path. I therefor put all the jars of my eclipse plugins
> directory in the classpath, but I still have the error. I really don't
> see what I should check, If someone has an idea.
> I use atl 3.0 and eclipse ganymede.
> Regards,
> Stephane
>
Re: [ATL] Ant task problem [message #486373 is a reply to message #484912] Thu, 17 September 2009 09:19 Go to previous messageGo to next message
Eclipse User
Originally posted by: monimambou-atl.yahoo.fr

Hi ,
Thanks for the answer. I had already checked with the documentation on ant
tasks. Should I understand that it's impossible to run the build.xml file
outside of an eclipse workbench ? The way I would like to launch my tasks
is on the command line exactly as I would do without eclipse. The point is
that the ant task seems not to be able to access eclipse plugin registry.
I'm suddenly afraid that ATL ant tasks are EClipse specific tasks... Any
reaction would help.
Best regards,
Stephane
Re: [ATL] Ant task problem [message #495233 is a reply to message #486373] Wed, 04 November 2009 04:54 Go to previous messageGo to next message
stephane  is currently offline stephane
Messages: 3
Registered: September 2009
Junior Member
Hi,

I've used ATL task to launch a transformation as showned in the Public2Private example that comes with ATL SDK. Most of the times it works well.

However, I've found that in case of models spanning over multiple files, it did not work well. Especially, stereotypes defined in external profiles are not recognized by a given ATL scripts launched with an Ant task, but the stereotypes are recognized by the same script launched directly within eclipse. I have the same problem with association ends to "external" classes.

I first thougt that the options "allowInterModelReferences" and "supportUML2Stereotypes" where not managed. I checked in the sources. They are used on calling the "launch" method of launchers, but not on calling lauchers initialize method (EMFVMLauncher initialize method is given those options but does nothing with them). I don't know if that makes a difference, buth there seems to be a problem with transformation of models that references other ones. All this while, the same tasks works great with models that have no external references.
Please also notice that givin the external model and profile as input to the transformation does not change anything.

I'm therefore really interessed in knowing whether someone succeded in handling transformations of model with external references and profiles through ATL ant task.

Best regards,
Stephane



Re: [ATL] Ant task problem [message #509489 is a reply to message #495233] Fri, 22 January 2010 10:20 Go to previous messageGo to next message
Dennis Hendriks is currently offline Dennis Hendriks
Messages: 63
Registered: January 2010
Location: Eindhoven, The Netherland...
Member
stephane wrote on Wed, 04 November 2009 10:54
Hi,

I've used ATL task to launch a transformation as showned in the Public2Private example that comes with ATL SDK. Most of the times it works well.



Did you manage to run the Ant build script with ATL tasks from the command line, that is, OUTSIDE of Eclipse?

Dennis
Re: [ATL] Ant task problem [message #556719 is a reply to message #495233] Thu, 02 September 2010 08:50 Go to previous messageGo to next message
Michael  is currently offline Michael
Messages: 2
Registered: September 2010
Junior Member
Hi,

I'd like to ask whether there has been any resolution to the problem that Stephane describes:
stephane wrote on Wed, 04 November 2009 04:54

However, I've found that in case of models spanning over multiple files, it did not work well.


(please read the whole description to get a better idea of the problem)

I'm facing the same problem when I'm trying to load a model that spans over two files (say, model elements in file2 reference model elements in file1). To do that, I use the following statements:
...
<atl.loadModel modelHandler="EMF" name="part1" metamodel="Ecore" path="file1.ecore" />
<atl.loadModel modelHandler="EMF" name="part2" metamodel="Ecore" path="file2.ecore" />
...

Interestingly, when I use the default launcher configuration (that is EMF-specific VM) the task completes successfully but the transformation output is incorrect.
When I set an alternative launcher using for example the statement:
	<property name="atl.launcher" value="Regular VM (with debugger)" />

I get as a result a set of warnings that look like the following:
Resource for org.eclipse.emf.ecore.impl.EClassImpl@109cdc8 (eProxyURI: file:/file1.ecore#//File1Element) is null; cannot be referenced

This happens even when I don't use the <atl.launch> tag in my script at all.

Finally, the above warnings disappeared when I copied file1.ecore into the root directory but the transformation output was still incorrect. (Also the number of instructions executed is different from that of a regular run through the Eclipse GUI, which I guess is a consequence of loading incorrectly the model).

Thank you in advance,

Michael
Re: [ATL] Ant task problem [message #556734 is a reply to message #484844] Thu, 02 September 2010 09:26 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 522
Registered: July 2009
Senior Member
If you load 2 files or more referencing each others, you have to load them exactly the same way they reference each others.

Let's say I have an ecore metamodel that references another metamodel using a platform resource URI.
If I want to transform those two metamodels and the references between them, I'll have to load the second metamodel using the same platform resource URI. If I use a OS absolute path to load the metamodel, the two metamodels will be loaded but ATL won't know about the references between them.

Really tricky eh ? Wink
Re: [ATL] Ant task problem [message #556813 is a reply to message #556734] Thu, 02 September 2010 13:08 Go to previous message
Michael  is currently offline Michael
Messages: 2
Registered: September 2010
Junior Member
Sylvain thank you for the reply! It's been very helpful.

I list here what worked for me in terms of the ATL ant task syntax in case anyone faces a similar problem. So, in relation to the example I gave earlier, the following will fix the problem:
Quote:
<atl.loadModel modelHandler="EMF" name="part1" metamodel="Ecore" nsURI="platform:/resource/<folder path>/file1.ecore" />
<atl.loadModel modelHandler="EMF" name="part2" metamodel="Ecore" nsURI="platform:/resource/<folder path>/file2.ecore" />


Regards,

Michael
Previous Topic:[QVTo] Truncate output file / do not append results
Next Topic:[QVTo] Failed to load model extent
Goto Forum:
  


Current Time: Sat Jul 26 05:16:36 EDT 2014

Powered by FUDForum. Page generated in 0.01628 seconds