Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » ANT Task VMException (Could not find model)(org.eclipse.m2m.atl.engine.emfvm.VMException: Could not find model kdm)
ANT Task VMException (Could not find model) [message #1062937] Tue, 11 June 2013 13:20 Go to next message
Burak Karaboga is currently offline Burak KarabogaFriend
Messages: 9
Registered: June 2013
Junior Member
Hi,

I'm trying to create an ant task to launch my ATL transformation and when I run my ant file as ant build I get this error:

run:
[atl.loadModel] Loading model UML2 from http://www.eclipse.org/uml2/2.1.0/UML
[atl.loadModel] Loading model testKDM from http://www.eclipse.org/MoDisco/kdm/code
[atl.loadModel] Loading model PRO from http://www.eclipse.org/uml2/4.0.0/UML/Profile/L3
[atl.loadModel] Loading model kdm from platform:/resource/eu.artist.m2m.componentextraction/model/petstoreEE6.kdm
[atl.loadModel] Loading model profile from platform:/resource/eu.artist.m2m.componentextraction/model/Annotation.profile.uml
  [atl.launch] Launching transformation C:\Burak\Dev\ARTIST\ARTIST-Experiments\Atos\WP8\eu.artist.m2m.componentextraction\transformation\KDMtoUML_WA.asm using EMF-specific VM
  [atl.launch] org.eclipse.m2m.atl.engine.emfvm.VMException: Could not find model kdm

BUILD FAILED
C:\Burak\Dev\ARTIST\ARTIST-Experiments\Atos\WP8\eu.artist.m2m.componentextraction\antLaunch_test.xml:14: Could not find model kdm



Here is my ant file:

<?xml version="1.0"?>
<project name="eu.artist.m2m.componentextraction" default="run" basedir=".">
	<property name="atl.launcher" value="EMF-specific VM" />
	<target name="run">
		<atl.loadModel name="UML2" metamodel="MOF" nsUri="http://www.eclipse.org/uml2/2.1.0/UML" />
		<atl.loadModel name="testKDM" metamodel="MOF" nsUri="http://www.eclipse.org/MoDisco/kdm/code" />
		<atl.loadModel name="PRO" metamodel="MOF" nsUri="http://www.eclipse.org/uml2/4.0.0/UML/Profile/L3" />

		<atl.loadModel modelhandler="testKDM" metamodel="testKDM" name="kdm" nsUri="platform:/resource/eu.artist.m2m.componentextraction/model/petstoreEE6.kdm" />
		<atl.loadModel modelhandler="PRO" metamodel="PRO" name="profile" nsUri="platform:/resource/eu.artist.m2m.componentextraction/model/Annotation.profile.uml" />
		
		<atl.launch path="transformation/KDMtoUML_WA.asm">
			<option name="supportUML2Stereotypes" value="true" />
			<inmodel name="IN" model="kdm" />
			<inmodel name="IN2" model="profile" />
			<outmodel name="OUT" model="uml" metamodel="UML2" modelhandler="UML2" />
		</atl.launch >
		<atl.saveModel model="uml" path="model/petstoreEE6_WA.uml" />
	</target>

</project>


My transformation header:

create OUT: uml from IN: kdm, IN2: profile;


Everything seems in order and kdm model is also successfully loaded (I think) but I get this error anyway. Does anyone have any idea why I might be getting this exception?

Re: ANT Task VMException (Could not find model) [message #1062966 is a reply to message #1062937] Tue, 11 June 2013 14:37 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hello,

To check that the KDM model loading is actually correct, have you tried to "save" back this model into a different file right after having loading it?


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: ANT Task VMException (Could not find model) [message #1062968 is a reply to message #1062966] Tue, 11 June 2013 14:40 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
It could also come from the fact that you are using the nsURI parameter for something that looks like a file path.
You could try to use the path parameter instead (cf. the ATL ANT Tasks documentation).


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: ANT Task VMException (Could not find model) [message #1063084 is a reply to message #1062968] Wed, 12 June 2013 08:42 Go to previous messageGo to next message
Burak Karaboga is currently offline Burak KarabogaFriend
Messages: 9
Registered: June 2013
Junior Member

Hi Hugo,

I have changed the parameter to path but I still get the same error.

By the way, the file can be saved successfully after loading. Saved file and the original one has different encodings but I don't think that might cause an error.


Re: ANT Task VMException (Could not find model) [message #1063134 is a reply to message #1063084] Wed, 12 June 2013 12:52 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
I've seen that you're setting the modelhandler parameter using incorrect values (cf. ATL ANT Tasks documentation).
If using the (standard) EMF-specific VM as I guess you're doing, this parameter is not valuable and so should not be set.
Does removing it improve the situation?


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: ANT Task VMException (Could not find model) [message #1063153 is a reply to message #1063134] Wed, 12 June 2013 13:47 Go to previous messageGo to next message
Burak Karaboga is currently offline Burak KarabogaFriend
Messages: 9
Registered: June 2013
Junior Member
I still get the same error after removing the modelhandler parameters.

I also removed everything in the code and just wrote one rule to see if the problem is with the kdm model:

rule TestRule {
	from src :profile!Element
	to tgt :uml!Profile (
		name <- src.name
	)
}


then I got this error:

  [atl.launch] org.eclipse.m2m.atl.engine.emfvm.VMException: Cannot find reference model profile
  [atl.launch] 	at __matchExtensionFamilyToProfile#2(KDMtoUML_WA.atl)
  [atl.launch] 		local variables: self=KDMtoUML_WA : ASMModule
  [atl.launch] 	at __matcher__#1(KDMtoUML_WA.atl)
  [atl.launch] 		local variables: self=KDMtoUML_WA : ASMModule
  [atl.launch] 	at main#22(KDMtoUML_WA.atl)
  [atl.launch] 		local variables: self=KDMtoUML_WA : ASMModule


I guess the problem is not just the kdm input model.


Re: ANT Task VMException (Could not find model) [message #1063202 is a reply to message #1063153] Wed, 12 June 2013 15:35 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
OK now I think I understand better what is the problem.
A UML profile is not a metamodel, it is actually a UML model (which conforms to the UML metamodel).
Thus, in your transformation, you have to provide your UML profile as an input model (that conforms to the UML metamodel).


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: ANT Task VMException (Could not find model) [message #1063470 is a reply to message #1063202] Thu, 13 June 2013 09:16 Go to previous messageGo to next message
Burak Karaboga is currently offline Burak KarabogaFriend
Messages: 9
Registered: June 2013
Junior Member
Changing it didn't help.

To narrow down the problem I tried something very simple:

ANT:
<?xml version="1.0"?>
<project name="eu.artist.m2m.componentextraction" default="run" basedir=".">
	<property name="atl.launcher" value="EMF-specific VM" />
	<target name="run">
		<atl.loadModel name="UML2" metamodel="MOF" nsUri="http://www.eclipse.org/uml2/4.0.0/UML" />
		<atl.loadModel metamodel="UML2" name="uml" path="model/petstoreEE6_WA.uml" />
		<atl.launch path="transformation/KDMtoUML/KDMtoUML_WA.asm">
			<inmodel name="IN" model="uml" />
			<outmodel name="OUT" model="umlout" metamodel="UML2" />
		</atl.launch >
		<atl.saveModel model="umlout" path="model/out.uml" />
	</target>
</project>


Transformation:
create OUT: umlout from IN: uml;

rule ExtensionFamilyToProfile {
	from src :uml!Class
	to tgt :umlout!Class (
		name <- src.name
	)
}


Error:
[atl.launch] org.eclipse.m2m.atl.engine.emfvm.VMException: Cannot find reference model uml
  [atl.launch] 	at __matchExtensionFamilyToProfile#2(KDMtoUML_WA.atl)
  [atl.launch] 		local variables: self=KDMtoUML_WA : ASMModule
  [atl.launch] 	at __matcher__#1(KDMtoUML_WA.atl)
  [atl.launch] 		local variables: self=KDMtoUML_WA : ASMModule
  [atl.launch] 	at main#22(KDMtoUML_WA.atl)
  [atl.launch] 		local variables: self=KDMtoUML_WA : ASMModule


This is really weird.

If it helps, I'm using Eclipse Modeling Project Version: Juno Service Release 2
Build id: 20130225-0426




Re: ANT Task VMException (Could not find model) [message #1063479 is a reply to message #1063470] Thu, 13 June 2013 09:32 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Hello,

Have you tried in parallel to launch the same transformation from a standard launch configuration to see if you get a similar error?
Also, you probably have to set the "Support UML2 stereotypes application" and "Allow inter-model references" EMF VM parameters to true.


--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Re: ANT Task VMException (Could not find model) [message #1063546 is a reply to message #1063479] Thu, 13 June 2013 11:56 Go to previous messageGo to next message
Burak Karaboga is currently offline Burak KarabogaFriend
Messages: 9
Registered: June 2013
Junior Member


Hi,

Thanks for your suggestions Hugo.

Yes I tried and standard launch configurations work perfectly. As for ANT tasks, setting those properties to true didn't change the result for me.
Re: ANT Task VMException (Could not find model) [message #1063605 is a reply to message #1063546] Thu, 13 June 2013 13:46 Go to previous messageGo to next message
Burak Karaboga is currently offline Burak KarabogaFriend
Messages: 9
Registered: June 2013
Junior Member

Problem solved. The issue is about inconsistency between the ATL header and the ANT task. Thanks for your suggestions Hugo.

I'll rewrite the working version of the simple example above for future reference to the people who may have a similar problem.

ANT:
<?xml version="1.0"?>
<project name="eu.artist.m2m.componentextraction" default="run" basedir=".">
	<property name="atl.launcher" value="EMF-specific VM" />
	<target name="run">
		<atl.loadModel name="UML2" metamodel="MOF" nsUri="http://www.eclipse.org/uml2/4.0.0/UML" />
		<atl.loadModel metamodel="UML2" name="uml" path="model/petstoreEE6_WA.uml" />
		<atl.launch path="transformation/KDMtoUML/KDMtoUML_WA.asm">
			<inmodel name="IN" model="uml" />
			<outmodel name="OUT" model="umlout" metamodel="UML2" />
		</atl.launch >
		<atl.saveModel model="umlout" path="model/out.uml" />
	</target>
</project>



Transformation:
create OUT: UML2 from IN: UML2;

rule SimpleRule {
	from src :UML2!Class
	to tgt :UML2!Class (
		name <- src.name
	)
}


Re: ANT Task VMException (Could not find model) [message #1063664 is a reply to message #1063605] Thu, 13 June 2013 16:20 Go to previous message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 674
Registered: July 2009
Senior Member
Great, thanks!

--------------------------------------------------------
Hugo Bruneliere, PhD
NaoMod team (IMT Atlantique & LS2N-CNRS)
Nantes - France
--------------------------------------------------------
Previous Topic:Simple Containment issue
Next Topic:EMFTVM Refining Mode
Goto Forum:
  


Current Time: Thu Mar 28 10:55:34 GMT 2024

Powered by FUDForum. Page generated in 0.25827 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top