Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Error injecting KM3 with Ant
[ATL] Error injecting KM3 with Ant [message #62196] Sat, 22 September 2007 10:14 Go to next message
Lorenzo Dalla Vecchia is currently offline Lorenzo Dalla VecchiaFriend
Messages: 58
Registered: July 2009
Member
Hello again.

To automate the build process of my project I created an Ant script to
inject a KM3 meta-model into the corrensponding EMF (Ecore) meta-model, and
ran it from Eclipse.
I'm using the following Ant target, almost cut-n-pasted from the wiki:

<!-- MODEL INJECTION -->
<target name="inject">
<am3.loadModel name="${model}" path="${model}.km3"
metamodel="KM3" modelHandler="EMF">
<injector name="ebnf">
<param name="name" value="KM3" />
</injector>
</am3.loadModel>
<am3.saveModel model="${model}" path="${model}.ecore" />
</target>

${model} is a Ant property set to the model name without extension (the .km3
file is correctly found).

When running the Ant task I get the following:

inject:
[am3.loadModel] GRAVE: no type named 'Metamodel' in metamodel 'ModelName'
[am3.loadModel] java.lang.NullPointerException
[am3.loadModel] at
org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.newModelElem ent(ASMEMFModel.java:185)
[am3.loadModel] at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMModel.newModelEle ment(ASMModel.java:76)
[am3.loadModel] at
org.eclipse.m2m.atl.engine.vm.nativelib.ASMModel.newModelEle ment(ASMModel.java:62)
[am3.loadModel] at
org.atl.engine.injectors.ebnf.ASMModelHandler.createElement( ASMModelHandler.java:89)
[am3.loadModel] at
org.atl.engine.injectors.ebnf.EBNFInjector2.create(EBNFInjec tor2.java:301)
[am3.loadModel] at
org.atl.engine.injectors.ebnf.KM3_ANTLR3Parser.metamodel(KM3 _ANTLR3Parser.java:318)
[am3.loadModel] at
org.atl.engine.injectors.ebnf.KM3_ANTLR3Parser.main(KM3_ANTL R3Parser.java:117)
[am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
[am3.loadModel] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
[am3.loadModel] at java.lang.reflect.Method.invoke(Unknown Source)
[am3.loadModel] at
org.eclipse.gmt.tcs.wrappers.antlr3.ParserWrapper.parse(Pars erWrapper.java:69)
[am3.loadModel] at
org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:253)
[am3.loadModel] at
org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:213)
[am3.loadModel] at
org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:162)
[am3.loadModel] at
org.atl.engine.injectors.ebnf.EBNFInjector2.inject(EBNFInjec tor2.java:92)
[am3.loadModel] at
org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.ebnfInje ction(AM3AntToolKit.java:256)
[am3.loadModel] at
org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.ebnfInje ction(AM3AntToolKit.java:273)
[am3.loadModel] at
org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.inject(A M3AntToolKit.java:281)
[am3.loadModel] at
org.eclipse.gmt.am3.tools.ant.tasks.LoadModelTask.execute(Lo adModelTask.java:62)
[am3.loadModel] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:275)
[am3.loadModel] at org.apache.tools.ant.Task.perform(Task.java:364)
[am3.loadModel] at org.apache.tools.ant.Target.execute(Target.java:341)
[am3.loadModel] at
org.apache.tools.ant.Target.performTasks(Target.java:369)
[am3.loadModel] at
org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1216)
[am3.loadModel] at
org.apache.tools.ant.Project.executeTarget(Project.java:1185 )
[am3.loadModel] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:40)
[am3.loadModel] at
org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.exe cuteTargets(EclipseDefaultExecutor.java:32)
[am3.loadModel] at
org.apache.tools.ant.Project.executeTargets(Project.java:106 8)
[am3.loadModel] at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:706)
[am3.loadModel] at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:457)
[am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
[am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
[am3.loadModel] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
[am3.loadModel] at java.lang.reflect.Method.invoke(Unknown Source)
[am3.loadModel] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
[am3.loadModel] at
org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDe legate$1.run(AntLaunchDelegate.java:230)
[am3.loadModel] at java.lang.Thread.run(Unknown Source)
[am3.saveModel] INFO: Saving model WebML
BUILD SUCCESSFUL
Total time: 163 milliseconds

Although it says "build successful", the resulting Ecore file is empty and
therefore not valid.
What does "no type named 'Metamodel' in metamodel 'ModelName'" mean? I'm
sure the KM3 file is syntax-correct and I can inject it successfully using
the context-menu command provided by the ATL Eclipse plugin.

Thank you in advance.

--
Lorenzo
Re: [ATL] Error injecting KM3 with Ant [message #62220 is a reply to message #62196] Sat, 22 September 2007 15:03 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

Did you load the KM3 metamodel in Ecore format (e.g., KM3.ecore, or
better, nsURI="http://www.eclipse.org/gmt/2005/KM3") before loading the
KM3 model?


Regards,

Frédéric Jouault

Lorenzo Dalla Vecchia wrote:
> Hello again.
>
> To automate the build process of my project I created an Ant script to
> inject a KM3 meta-model into the corrensponding EMF (Ecore) meta-model,
> and ran it from Eclipse.
> I'm using the following Ant target, almost cut-n-pasted from the wiki:
>
> <!-- MODEL INJECTION -->
> <target name="inject">
> <am3.loadModel name="${model}" path="${model}.km3"
> metamodel="KM3" modelHandler="EMF">
> <injector name="ebnf">
> <param name="name" value="KM3" />
> </injector>
> </am3.loadModel>
> <am3.saveModel model="${model}" path="${model}.ecore" />
> </target>
>
> ${model} is a Ant property set to the model name without extension (the
> .km3 file is correctly found).
>
> When running the Ant task I get the following:
>
> inject:
> [am3.loadModel] GRAVE: no type named 'Metamodel' in metamodel 'ModelName'
> [am3.loadModel] java.lang.NullPointerException
> [am3.loadModel] at
> org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.newModelElem ent(ASMEMFModel.java:185)
>
> [am3.loadModel] at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMModel.newModelEle ment(ASMModel.java:76)
>
> [am3.loadModel] at
> org.eclipse.m2m.atl.engine.vm.nativelib.ASMModel.newModelEle ment(ASMModel.java:62)
>
> [am3.loadModel] at
> org.atl.engine.injectors.ebnf.ASMModelHandler.createElement( ASMModelHandler.java:89)
>
> [am3.loadModel] at
> org.atl.engine.injectors.ebnf.EBNFInjector2.create(EBNFInjec tor2.java:301)
> [am3.loadModel] at
> org.atl.engine.injectors.ebnf.KM3_ANTLR3Parser.metamodel(KM3 _ANTLR3Parser.java:318)
>
> [am3.loadModel] at
> org.atl.engine.injectors.ebnf.KM3_ANTLR3Parser.main(KM3_ANTL R3Parser.java:117)
>
> [am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> [am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
> Source)
> [am3.loadModel] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> [am3.loadModel] at java.lang.reflect.Method.invoke(Unknown Source)
> [am3.loadModel] at
> org.eclipse.gmt.tcs.wrappers.antlr3.ParserWrapper.parse(Pars erWrapper.java:69)
>
> [am3.loadModel] at
> org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:253)
>
> [am3.loadModel] at
> org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:213)
>
> [am3.loadModel] at
> org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:162)
>
> [am3.loadModel] at
> org.atl.engine.injectors.ebnf.EBNFInjector2.inject(EBNFInjec tor2.java:92)
> [am3.loadModel] at
> org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.ebnfInje ction(AM3AntToolKit.java:256)
>
> [am3.loadModel] at
> org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.ebnfInje ction(AM3AntToolKit.java:273)
>
> [am3.loadModel] at
> org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.inject(A M3AntToolKit.java:281)
>
> [am3.loadModel] at
> org.eclipse.gmt.am3.tools.ant.tasks.LoadModelTask.execute(Lo adModelTask.java:62)
>
> [am3.loadModel] at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:275)
> [am3.loadModel] at org.apache.tools.ant.Task.perform(Task.java:364)
> [am3.loadModel] at org.apache.tools.ant.Target.execute(Target.java:341)
> [am3.loadModel] at
> org.apache.tools.ant.Target.performTasks(Target.java:369)
> [am3.loadModel] at
> org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1216)
> [am3.loadModel] at
> org.apache.tools.ant.Project.executeTarget(Project.java:1185 )
> [am3.loadModel] at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:40)
>
> [am3.loadModel] at
> org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.exe cuteTargets(EclipseDefaultExecutor.java:32)
>
> [am3.loadModel] at
> org.apache.tools.ant.Project.executeTargets(Project.java:106 8)
> [am3.loadModel] at
> org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:706)
>
> [am3.loadModel] at
> org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:457)
>
> [am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> [am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
> Source)
> [am3.loadModel] at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> [am3.loadModel] at java.lang.reflect.Method.invoke(Unknown Source)
> [am3.loadModel] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
> [am3.loadModel] at
> org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDe legate$1.run(AntLaunchDelegate.java:230)
>
> [am3.loadModel] at java.lang.Thread.run(Unknown Source)
> [am3.saveModel] INFO: Saving model WebML
> BUILD SUCCESSFUL
> Total time: 163 milliseconds
>
> Although it says "build successful", the resulting Ecore file is empty
> and therefore not valid.
> What does "no type named 'Metamodel' in metamodel 'ModelName'" mean? I'm
> sure the KM3 file is syntax-correct and I can inject it successfully
> using the context-menu command provided by the ATL Eclipse plugin.
>
> Thank you in advance.
>
> --
> Lorenzo
Re: [ATL] Error injecting KM3 with Ant [message #62245 is a reply to message #62220] Sat, 22 September 2007 22:48 Go to previous messageGo to next message
Lorenzo Dalla Vecchia is currently offline Lorenzo Dalla VecchiaFriend
Messages: 58
Registered: July 2009
Member
You were right, I totally forgot to load the KM3 metamodel itself.
However there is still a problem with the following new code:

<target name="inject">
<am3.loadModel modelHandler="EMF" name="KM3"
nsUri="http://www.eclipse.org/gmt/2005/KM3"
metamodel="MOF" />
<am3.loadModel modelHandler="EMF" name="${model}"
path="${model}.km3" metamodel="KM3">
<injector name="ebnf">
<param name="name" value="KM3" />
</injector>
</am3.loadModel>
<am3.saveModel model="${model}" path="${model}.ecore" />
</target>

Unlike Ecore files produced by the Eclipse plugin, the resulting Ecore file
does not use the namespace http://www.eclipse.org/emf/2002/Ecore and
elements like eClass, eAttribute but the KM3 namespace
(http://www.eclipse.org/gmt/2005/KM3) and different elements like Metamodel
and Contents, thus making it incompatible with other EMF tools.

I'm sure that there is a simple way of fixing this problem, maybe adding
another injector parameter... Sorry, I'm a bit newbie with these tools.

Regards.

--
Lorenzo


"Frédéric Jouault" <frederic.jouault@univ-nantes.fr> ha scritto nel
messaggio news:fd3ari$g9f$1@build.eclipse.org...
> Hello,
>
> Did you load the KM3 metamodel in Ecore format (e.g., KM3.ecore, or
> better, nsURI="http://www.eclipse.org/gmt/2005/KM3") before loading the
> KM3 model?
>
>
> Regards,
>
> Frédéric Jouault
>
> Lorenzo Dalla Vecchia wrote:
>> Hello again.
>>
>> To automate the build process of my project I created an Ant script to
>> inject a KM3 meta-model into the corrensponding EMF (Ecore) meta-model,
>> and ran it from Eclipse.
>> I'm using the following Ant target, almost cut-n-pasted from the wiki:
>>
>> <!-- MODEL INJECTION -->
>> <target name="inject">
>> <am3.loadModel name="${model}" path="${model}.km3"
>> metamodel="KM3" modelHandler="EMF">
>> <injector name="ebnf">
>> <param name="name" value="KM3" />
>> </injector>
>> </am3.loadModel>
>> <am3.saveModel model="${model}" path="${model}.ecore" />
>> </target>
>>
>> ${model} is a Ant property set to the model name without extension (the
>> .km3 file is correctly found).
>>
>> When running the Ant task I get the following:
>>
>> inject:
>> [am3.loadModel] GRAVE: no type named 'Metamodel' in metamodel 'ModelName'
>> [am3.loadModel] java.lang.NullPointerException
>> [am3.loadModel] at
>> org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.newModelElem ent(ASMEMFModel.java:185)
>> [am3.loadModel] at
>> org.eclipse.m2m.atl.engine.vm.nativelib.ASMModel.newModelEle ment(ASMModel.java:76)
>> [am3.loadModel] at
>> org.eclipse.m2m.atl.engine.vm.nativelib.ASMModel.newModelEle ment(ASMModel.java:62)
>> [am3.loadModel] at
>> org.atl.engine.injectors.ebnf.ASMModelHandler.createElement( ASMModelHandler.java:89)
>> [am3.loadModel] at
>> org.atl.engine.injectors.ebnf.EBNFInjector2.create(EBNFInjec tor2.java:301)
>> [am3.loadModel] at
>> org.atl.engine.injectors.ebnf.KM3_ANTLR3Parser.metamodel(KM3 _ANTLR3Parser.java:318)
>> [am3.loadModel] at
>> org.atl.engine.injectors.ebnf.KM3_ANTLR3Parser.main(KM3_ANTL R3Parser.java:117)
>> [am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> [am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
>> Source)
>> [am3.loadModel] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> [am3.loadModel] at java.lang.reflect.Method.invoke(Unknown Source)
>> [am3.loadModel] at
>> org.eclipse.gmt.tcs.wrappers.antlr3.ParserWrapper.parse(Pars erWrapper.java:69)
>> [am3.loadModel] at
>> org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:253)
>> [am3.loadModel] at
>> org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:213)
>> [am3.loadModel] at
>> org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:162)
>> [am3.loadModel] at
>> org.atl.engine.injectors.ebnf.EBNFInjector2.inject(EBNFInjec tor2.java:92)
>> [am3.loadModel] at
>> org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.ebnfInje ction(AM3AntToolKit.java:256)
>> [am3.loadModel] at
>> org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.ebnfInje ction(AM3AntToolKit.java:273)
>> [am3.loadModel] at
>> org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.inject(A M3AntToolKit.java:281)
>> [am3.loadModel] at
>> org.eclipse.gmt.am3.tools.ant.tasks.LoadModelTask.execute(Lo adModelTask.java:62)
>> [am3.loadModel] at
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:275)
>> [am3.loadModel] at org.apache.tools.ant.Task.perform(Task.java:364)
>> [am3.loadModel] at org.apache.tools.ant.Target.execute(Target.java:341)
>> [am3.loadModel] at
>> org.apache.tools.ant.Target.performTasks(Target.java:369)
>> [am3.loadModel] at
>> org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1216)
>> [am3.loadModel] at
>> org.apache.tools.ant.Project.executeTarget(Project.java:1185 )
>> [am3.loadModel] at
>> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:40)
>> [am3.loadModel] at
>> org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.exe cuteTargets(EclipseDefaultExecutor.java:32)
>> [am3.loadModel] at
>> org.apache.tools.ant.Project.executeTargets(Project.java:106 8)
>> [am3.loadModel] at
>> org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:706)
>> [am3.loadModel] at
>> org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:457)
>> [am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>> [am3.loadModel] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
>> Source)
>> [am3.loadModel] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>> [am3.loadModel] at java.lang.reflect.Method.invoke(Unknown Source)
>> [am3.loadModel] at
>> org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
>> [am3.loadModel] at
>> org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDe legate$1.run(AntLaunchDelegate.java:230)
>> [am3.loadModel] at java.lang.Thread.run(Unknown Source)
>> [am3.saveModel] INFO: Saving model WebML
>> BUILD SUCCESSFUL
>> Total time: 163 milliseconds
>>
>> Although it says "build successful", the resulting Ecore file is empty
>> and therefore not valid.
>> What does "no type named 'Metamodel' in metamodel 'ModelName'" mean? I'm
>> sure the KM3 file is syntax-correct and I can inject it successfully
>> using the context-menu command provided by the ATL Eclipse plugin.
>>
>> Thank you in advance.
>>
>> --
>> Lorenzo
Re: [ATL] Error injecting KM3 with Ant [message #62268 is a reply to message #62245] Sun, 23 September 2007 16:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikael.barbero.gmail.com

Hi Lorenzo,

After the injection of your .km3 file, you get a KM3 model (M1 level),
conforming to the KM3 metamodel (M2 level), itself conforming to Ecore
(M3 level). If you want to get a metamodel from the KM3 model, you have
to "promote" this model. You can do this with the transformation KM32Ecore.

Regards,
Mikael

Lorenzo Dalla Vecchia wrote:
> You were right, I totally forgot to load the KM3 metamodel itself.
> However there is still a problem with the following new code:
>
> <target name="inject">
> <am3.loadModel modelHandler="EMF" name="KM3"
> nsUri="http://www.eclipse.org/gmt/2005/KM3"
> metamodel="MOF" />
> <am3.loadModel modelHandler="EMF" name="${model}"
> path="${model}.km3" metamodel="KM3">
> <injector name="ebnf">
> <param name="name" value="KM3" />
> </injector>
> </am3.loadModel>
> <am3.saveModel model="${model}" path="${model}.ecore" />
> </target>
>
> Unlike Ecore files produced by the Eclipse plugin, the resulting Ecore
> file does not use the namespace http://www.eclipse.org/emf/2002/Ecore
> and elements like eClass, eAttribute but the KM3 namespace
> (http://www.eclipse.org/gmt/2005/KM3) and different elements like
> Metamodel and Contents, thus making it incompatible with other EMF tools.
>
> I'm sure that there is a simple way of fixing this problem, maybe adding
> another injector parameter... Sorry, I'm a bit newbie with these tools.
>
> Regards.
>
> --
> Lorenzo
>
>
> "Frédéric Jouault" <frederic.jouault@univ-nantes.fr> ha scritto nel
> messaggio news:fd3ari$g9f$1@build.eclipse.org...
>> Hello,
>>
>> Did you load the KM3 metamodel in Ecore format (e.g., KM3.ecore, or
>> better, nsURI="http://www.eclipse.org/gmt/2005/KM3") before loading
>> the KM3 model?
>>
>>
>> Regards,
>>
>> Frédéric Jouault
>>
>> Lorenzo Dalla Vecchia wrote:
>>> Hello again.
>>>
>>> To automate the build process of my project I created an Ant script
>>> to inject a KM3 meta-model into the corrensponding EMF (Ecore)
>>> meta-model, and ran it from Eclipse.
>>> I'm using the following Ant target, almost cut-n-pasted from the wiki:
>>>
>>> <!-- MODEL INJECTION -->
>>> <target name="inject">
>>> <am3.loadModel name="${model}" path="${model}.km3"
>>> metamodel="KM3" modelHandler="EMF">
>>> <injector name="ebnf">
>>> <param name="name" value="KM3" />
>>> </injector>
>>> </am3.loadModel>
>>> <am3.saveModel model="${model}" path="${model}.ecore" />
>>> </target>
>>>
>>> ${model} is a Ant property set to the model name without extension
>>> (the .km3 file is correctly found).
>>>
>>> When running the Ant task I get the following:
>>>
>>> inject:
>>> [am3.loadModel] GRAVE: no type named 'Metamodel' in metamodel
>>> 'ModelName'
>>> [am3.loadModel] java.lang.NullPointerException
>>> [am3.loadModel] at
>>> org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModel.newModelElem ent(ASMEMFModel.java:185)
>>> [am3.loadModel] at
>>> org.eclipse.m2m.atl.engine.vm.nativelib.ASMModel.newModelEle ment(ASMModel.java:76)
>>> [am3.loadModel] at
>>> org.eclipse.m2m.atl.engine.vm.nativelib.ASMModel.newModelEle ment(ASMModel.java:62)
>>> [am3.loadModel] at
>>> org.atl.engine.injectors.ebnf.ASMModelHandler.createElement( ASMModelHandler.java:89)
>>> [am3.loadModel] at
>>> org.atl.engine.injectors.ebnf.EBNFInjector2.create(EBNFInjec tor2.java:301)
>>>
>>> [am3.loadModel] at
>>> org.atl.engine.injectors.ebnf.KM3_ANTLR3Parser.metamodel(KM3 _ANTLR3Parser.java:318)
>>> [am3.loadModel] at
>>> org.atl.engine.injectors.ebnf.KM3_ANTLR3Parser.main(KM3_ANTL R3Parser.java:117)
>>> [am3.loadModel] at
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> [am3.loadModel] at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>> [am3.loadModel] at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>> [am3.loadModel] at java.lang.reflect.Method.invoke(Unknown Source)
>>> [am3.loadModel] at
>>> org.eclipse.gmt.tcs.wrappers.antlr3.ParserWrapper.parse(Pars erWrapper.java:69)
>>> [am3.loadModel] at
>>> org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:253)
>>> [am3.loadModel] at
>>> org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:213)
>>> [am3.loadModel] at
>>> org.atl.engine.injectors.ebnf.EBNFInjector2.performImportati on(EBNFInjector2.java:162)
>>> [am3.loadModel] at
>>> org.atl.engine.injectors.ebnf.EBNFInjector2.inject(EBNFInjec tor2.java:92)
>>>
>>> [am3.loadModel] at
>>> org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.ebnfInje ction(AM3AntToolKit.java:256)
>>> [am3.loadModel] at
>>> org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.ebnfInje ction(AM3AntToolKit.java:273)
>>> [am3.loadModel] at
>>> org.eclipse.gmt.am3.tools.ant.toolkit.AM3AntToolKit.inject(A M3AntToolKit.java:281)
>>> [am3.loadModel] at
>>> org.eclipse.gmt.am3.tools.ant.tasks.LoadModelTask.execute(Lo adModelTask.java:62)
>>> [am3.loadModel] at
>>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:275)
>>> [am3.loadModel] at org.apache.tools.ant.Task.perform(Task.java:364)
>>> [am3.loadModel] at org.apache.tools.ant.Target.execute(Target.java:341)
>>> [am3.loadModel] at
>>> org.apache.tools.ant.Target.performTasks(Target.java:369)
>>> [am3.loadModel] at
>>> org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1216)
>>> [am3.loadModel] at
>>> org.apache.tools.ant.Project.executeTarget(Project.java:1185 )
>>> [am3.loadModel] at
>>> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:40)
>>> [am3.loadModel] at
>>> org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.exe cuteTargets(EclipseDefaultExecutor.java:32)
>>> [am3.loadModel] at
>>> org.apache.tools.ant.Project.executeTargets(Project.java:106 8)
>>> [am3.loadModel] at
>>> org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:706)
>>> [am3.loadModel] at
>>> org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:457)
>>> [am3.loadModel] at
>>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> [am3.loadModel] at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>>> [am3.loadModel] at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>>> [am3.loadModel] at java.lang.reflect.Method.invoke(Unknown Source)
>>> [am3.loadModel] at
>>> org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
>>> [am3.loadModel] at
>>> org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDe legate$1.run(AntLaunchDelegate.java:230)
>>> [am3.loadModel] at java.lang.Thread.run(Unknown Source)
>>> [am3.saveModel] INFO: Saving model WebML
>>> BUILD SUCCESSFUL
>>> Total time: 163 milliseconds
>>>
>>> Although it says "build successful", the resulting Ecore file is
>>> empty and therefore not valid.
>>> What does "no type named 'Metamodel' in metamodel 'ModelName'" mean?
>>> I'm sure the KM3 file is syntax-correct and I can inject it
>>> successfully using the context-menu command provided by the ATL
>>> Eclipse plugin.
>>>
>>> Thank you in advance.
>>>
>>> --
>>> Lorenzo
>



--
Mikaël Barbero - PhD Candidate
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssinière
44322 Nantes Cedex 3 - France
tel. +33 2 51 12 58 08 /\ cell.+33 6 07 63 19 00
email: Mikael.Barbero@{gmail.com, univ-nantes.fr}
http://www.sciences.univ-nantes.fr/lina/atl/
Re: [ATL] Error injecting KM3 with Ant [message #62315 is a reply to message #62268] Mon, 24 September 2007 19:54 Go to previous message
Lorenzo Dalla Vecchia is currently offline Lorenzo Dalla VecchiaFriend
Messages: 58
Registered: July 2009
Member
> After the injection of your .km3 file, you get a KM3 model (M1 level),
> conforming to the KM3 metamodel (M2 level), itself conforming to Ecore (M3
> level). If you want to get a metamodel from the KM3 model, you have to
> "promote" this model. You can do this with the transformation KM32Ecore.

It worked adding an am3.atl task for the trasformation.
Thanks a lot!

--
Lorenzo
Previous Topic:[M2M] [Fwd: Re: resolving volatile references]
Next Topic:Re: 'EStructuralFeature' is not a valid classifier
Goto Forum:
  


Current Time: Fri May 14 01:37:07 GMT 2021

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

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

Back to the top