Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] In-place injection
[ATL] In-place injection [message #37105] Fri, 11 May 2007 11:01 Go to next message
Lorenzo Dalla Vecchia is currently offline Lorenzo Dalla VecchiaFriend
Messages: 58
Registered: July 2009
Member
Hi.

I have successfully created a TCS injector and I have put it in the
classpath of the Ant script running my ATL transofrmation.
Now I want to do in-place injection of strings using the TCS injector.

I'm calling the "inject" method in the procedural section of a matched rule
using the following code:

myString.inject('DER', 'ebnf2', 'KM3')

Unfortunaltly, this is raising an exception in the ATL Standard Library that
I can't debug nor trace (and the trace is truncated).

----------------- BEGIN STACK TRACE -----------------
[am3.atl] exception:
[am3.atl] java.lang.reflect.InvocationTargetException
[am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[am3.atl] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[am3.atl] at java.lang.reflect.Method.invoke(Unknown Source)
[am3.atl] at
org.atl.engine.vm.ClassNativeOperation.exec(ClassNativeOpera tion.java:59)
[am3.atl] at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
[am3.atl] at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
[am3.atl] at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
[am3.atl] at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
[am3.atl] at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
[am3.atl] at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
[am3.atl] at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
[am3.atl] at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:30 9)
[am3.atl] at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
[am3.atl] at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
[am3.atl] at org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
[am3.atl] at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
[am3.atl] at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
[am3.atl] at
org.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:276)
[am3.atl] at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:1 36)
[am3.atl] at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:9 4)
[am3.atl] at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 8)
[am3.atl] at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 0)
[am3.atl] at
org.eclipse.gmt.am3.tools.ant.tasks.ATLModelTransformationTa sk.executeATLModelTransformationTask.java:108)
[am3.atl] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
[am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[am3.atl] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[am3.atl] at java.lang.reflect.Method.invoke(Unknown Source)
[am3.atl] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:105)
[am3.atl] at org.apache.tools.ant.Task.perform(Task.java:348)
[am3.atl] at org.apache.tools.ant.Target.execute(Target.java:357)
[am3.atl] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[am3.atl] at
org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1329)
[am3.atl] at org.apache.tools.ant.Project.executeTarget(Project.java:1298 )
[am3.atl] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:41)
[am3.atl] at
org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.exe cuteTargets(EclipseDefaultExecutor.java:32)
[am3.atl] at org.apache.tools.ant.Project.executeTargets(Project.java:118 1)
[am3.atl] at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:706)
[am3.atl] at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:457)
[am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[am3.atl] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[am3.atl] at java.lang.reflect.Method.invoke(Unknown Source)
[am3.atl] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
[am3.atl] at
org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDe legate$1.run(AntLaunchDelegate.java:230)
[am3.atl] at java.lang.Thread.run(Unknown Source)
[am3.atl] Caused by: java.lang.NullPointerException
[am3.atl] at
org.atl.engine.vm.nativelib.ASMString.inject(ASMString.java: 258)
[am3.atl] ... 47 more
--------------------- END STACK TRACE ------------------------

'DER' is the name of one of the two output models in the ATL file: it is
recognized correctly, because when I change it to anything else, the
exception is thrown one line before in ASMString.java.
'ebnf2' is the "kind" of injector; I also tried 'ebnf' because I found that
the files in the TCS importer JAR are in the org.atl.engine.injectors.ebnf;
package: no success
Maybe I am not using the correct version of TCS? I downloaded the one linked
in the Wiki.

Thanks in advance for any help.

--
Lorenzo
Re: [ATL] In-place injection [message #37244 is a reply to message #37105] Fri, 11 May 2007 13:21 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,

Is this the same problem as the one you reported in the thread "[ATL]
Parsing context-free language"? Or is it a different one?


Best regards,

Frédéric Jouault


Lorenzo Dalla Vecchia wrote:
> Hi.
>
> I have successfully created a TCS injector and I have put it in the
> classpath of the Ant script running my ATL transofrmation.
> Now I want to do in-place injection of strings using the TCS injector.
>
> I'm calling the "inject" method in the procedural section of a matched
> rule using the following code:
>
> myString.inject('DER', 'ebnf2', 'KM3')
>
> Unfortunaltly, this is raising an exception in the ATL Standard Library
> that I can't debug nor trace (and the trace is truncated).
>
> ----------------- BEGIN STACK TRACE -----------------
> [am3.atl] exception:
> [am3.atl] java.lang.reflect.InvocationTargetException
> [am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> [am3.atl] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> [am3.atl] at java.lang.reflect.Method.invoke(Unknown Source)
> [am3.atl] at
> org.atl.engine.vm.ClassNativeOperation.exec(ClassNativeOpera tion.java:59)
> [am3.atl] at
> org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
> [am3.atl] at
> org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
> [am3.atl] at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
> [am3.atl] at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
> [am3.atl] at
> org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
> [am3.atl] at
> org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
> [am3.atl] at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
> [am3.atl] at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:30 9)
> [am3.atl] at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
> [am3.atl] at
> org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 60)
> [am3.atl] at
> org.atl.engine.vm.nativelib.ASMOclAny.invoke(ASMOclAny.java: 50)
> [am3.atl] at org.atl.engine.vm.ASMOperation.realExec(ASMOperation.java:21 4)
> [am3.atl] at org.atl.engine.vm.ASMOperation.exec(ASMOperation.java:155)
> [am3.atl] at
> org.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:276)
> [am3.atl] at
> org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:1 36)
> [am3.atl] at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:9 4)
> [am3.atl] at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 8)
> [am3.atl] at org.atl.eclipse.engine.AtlLauncher.launch(AtlLauncher.java:6 0)
> [am3.atl] at
> org.eclipse.gmt.am3.tools.ant.tasks.ATLModelTransformationTa sk.executeATLModelTransformationTask.java:108)
>
> [am3.atl] at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.j ava:288)
> [am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> [am3.atl] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> [am3.atl] at java.lang.reflect.Method.invoke(Unknown Source)
> [am3.atl] at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(Dispatch Utils.java:105)
> [am3.atl] at org.apache.tools.ant.Task.perform(Task.java:348)
> [am3.atl] at org.apache.tools.ant.Target.execute(Target.java:357)
> [am3.atl] at org.apache.tools.ant.Target.performTasks(Target.java:385)
> [am3.atl] at
> org.apache.tools.ant.Project.executeSortedTargets(Project.ja va:1329)
> [am3.atl] at org.apache.tools.ant.Project.executeTarget(Project.java:1298 )
> [am3.atl] at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(D efaultExecutor.java:41)
>
> [am3.atl] at
> org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.exe cuteTargets(EclipseDefaultExecutor.java:32)
>
> [am3.atl] at org.apache.tools.ant.Project.executeTargets(Project.java:118 1)
> [am3.atl] at
> org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:706)
>
> [am3.atl] at
> org.eclipse.ant.internal.core.ant.InternalAntRunner.run(Inte rnalAntRunner.java:457)
>
> [am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [am3.atl] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> [am3.atl] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
> Source)
> [am3.atl] at java.lang.reflect.Method.invoke(Unknown Source)
> [am3.atl] at org.eclipse.ant.core.AntRunner.run(AntRunner.java:356)
> [am3.atl] at
> org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDe legate$1.run(AntLaunchDelegate.java:230)
>
> [am3.atl] at java.lang.Thread.run(Unknown Source)
> [am3.atl] Caused by: java.lang.NullPointerException
> [am3.atl] at
> org.atl.engine.vm.nativelib.ASMString.inject(ASMString.java: 258)
> [am3.atl] ... 47 more
> --------------------- END STACK TRACE ------------------------
>
> 'DER' is the name of one of the two output models in the ATL file: it is
> recognized correctly, because when I change it to anything else, the
> exception is thrown one line before in ASMString.java.
> 'ebnf2' is the "kind" of injector; I also tried 'ebnf' because I found
> that the files in the TCS importer JAR are in the
> org.atl.engine.injectors.ebnf; package: no success
> Maybe I am not using the correct version of TCS? I downloaded the one
> linked in the Wiki.
>
> Thanks in advance for any help.
>
> --
> Lorenzo
>
>
Re: [ATL] In-place injection [message #37278 is a reply to message #37244] Fri, 11 May 2007 19:30 Go to previous messageGo to next message
Lorenzo Dalla Vecchia is currently offline Lorenzo Dalla VecchiaFriend
Messages: 58
Registered: July 2009
Member
> Is this the same problem as the one you reported in the thread "[ATL]
> Parsing context-free language"? Or is it a different one?

It is the same, but with some information/ideas added plus a complete
(almost) stack trace.
I think it was good for it to have it's own thread, as it looked like a more
general issue.

> You did find a bug :-).
>
> The String.inject(...) operation had never been tested from within
> Eclipse. The current implementation depends on an object only present when
> the ATL VM is launched from command line

When I'm done creating the transofmration I plan to invoke it from Java code
in another application. With proper references to all needed classes it
should be possible to make it work, shouldn't it? Which exactly is the
missing object?

Thanks.

--
Lorenzo
Re: [ATL] In-place injection [message #37312 is a reply to message #37278] Sat, 12 May 2007 00:06 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

>> Is this the same problem as the one you reported in the thread "[ATL]
>> Parsing context-free language"? Or is it a different one?
>
> It is the same, but with some information/ideas added plus a complete
> (almost) stack trace.
> I think it was good for it to have it's own thread, as it looked like a
> more general issue.

Ok. Thank you for the additional information :-).

>> You did find a bug :-).
>>
>> The String.inject(...) operation had never been tested from within
>> Eclipse. The current implementation depends on an object only present
>> when the ATL VM is launched from command line
>
> When I'm done creating the transofmration I plan to invoke it from Java
> code in another application. With proper references to all needed
> classes it should be possible to make it work, shouldn't it? Which
> exactly is the missing object?

You asked for the technical details, so here there are ;-):

ASMString.inject(...) actually uses the old command-line API
(ModelLoader, EMFModelLoader), which is usually not necessary in Eclipse.

However, this API enables injector registration (i.e., using it removes
the need to add dirty plugin dependencies), and is not incompatible with
the new API (i.e., it can coexist). Therefore, I added an EMFModelLoader
in AtlEMFModelHandler (i.e., the new API) to make ASMString.inject(...)
work.

Note that I did *not* do this for MDR yet because there are some
technical issues making it slightly more complex.




These modifications have been tested, and committed to the Eclipse M2M
CVS repository.

Please, let me know if you have further issues.


Best regards,

Frédéric Jouault
Previous Topic:[ATL] Parsing context-free language
Next Topic:Re: [ATL] How to create a new class
Goto Forum:
  


Current Time: Mon Jan 18 08:56:01 GMT 2021

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

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

Back to the top