Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » AMW » Programmatically launching a composition: java.lang.reflect.InvocationTargetException
Programmatically launching a composition: java.lang.reflect.InvocationTargetException [message #470301] Sat, 27 June 2009 22:47 Go to next message
Juan Pedro Silva is currently offline Juan Pedro Silva
Messages: 258
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------050706060507030606020403
Content-Type: multipart/alternative;
boundary="------------000103090702000907050506"


--------------000103090702000907050506
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi everybody,
I'm trying to launch a composition programmatically,
but can't get it right.
The composition works fine with the same models in a launch configuration.
I use the same metamodels (I register them in a plugin, and use them as
"uri:..") both in the launch configuration and the java transf.
I only don't register weaving metamodel , I use it locally for the
launch, and an exact copy of it in the plugin (I'm telling just in case
this affects somehow).
I also use a piece of code that works fine with ATL transformations
(based on
http://wiki.eclipse.org/JWT_Transformations#How_to_call_an_A TL_transformation_in_java_.28e.g._in_a_transformation_plugin .29
), but a little tweaked for loading the AMW models.

Some excerpts of my code follow.
To get the handlers, I write:

emfModelHandler = (AtlEMFModelHandler)
AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF);
amwModelHandler = new AmwModelHandler(); // --> I DIDN'T FIND A STATIC
METHOD TO GET THE HANDLER!!.

I load the weaving metamodel (I use to load the metamodel as
ASMEMFModel, but it wasn't working, so I tried it this way) and the
weaving model as ASMAMWModels:

ASMAMWModel weavingModel = (ASMAMWModel) amwModelHandler.loadModel(
"SOMENAME", amwModelHandler.getMof(), "SOMEPATH"); //
---> SHOULD IT BE getAtl() ?? Doesn't work either

The rest of the (meta)models, as ASMEMFModels:

(ASMEMFModel) emfModelHandler.loadModel(...

and then launch as:

AtlLauncher.getDefault().launch(this.transfoResource,
Collections.EMPTY_MAP, models,
Collections.EMPTY_MAP,
Collections.EMPTY_LIST, Collections.EMPTY_MAP);

Regretfully, when running this code, I get the attached exception (after
some tranformation's "print-to-screen debugging" comments).
Any ideas on the probable cause?, I guess I'm doing something wrong with
the handlers and/or the loading, but can't find any example code to base
mine on.
Thanks in advance and best regards,
Juan Pedro



--------------000103090702000907050506
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi everybody, <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; I'm trying to launch a composition
programmatically, but can't get it right.<br>
The composition works fine with the same models in a launch
configuration.<br>
I use the same metamodels (I register them in a plugin, and use them as
"uri:..") both in the launch configuration and the java transf.<br>
I only don't register weaving metamodel , I use it locally for the
launch, and an exact copy of it in the plugin (I'm telling just in case
this affects somehow).<br>
I also use a piece of code that works fine with ATL transformations
(based on <br>
<a class="moz-txt-link-freetext" href=" http://wiki.eclipse.org/JWT_Transformations#How_to_call_an_A TL_transformation_in_java_.28e.g._in_a_transformation_plugin .29"> http://wiki.eclipse.org/JWT_Transformations#How_to_call_an_A TL_transformation_in_java_.28e.g._in_a_transformation_plugin .29</a><br>
), but a little tweaked for loading the AMW models.<br>
<br>
Some excerpts of my code follow.<br>
To get the handlers, I write:<br>
<font face="Courier New, Courier, monospace"><br>
<font color="#009900">emfModelHandler = (AtlEMFModelHandler)
AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF);&nbs p;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp; <br>
amwModelHandler = new AmwModelHandler(); // --&gt; I DIDN'T FIND A
STATIC METHOD TO GET THE HANDLER!!.</font></font><font color="#009900"><br>
</font><br>
I load the weaving metamodel (I use to load the metamodel as
ASMEMFModel, but it wasn't working, so I tried it this way) and the
weaving model as ASMAMWModels:<br>
<br>
<font color="#009900" face="Courier New, Courier, monospace">ASMAMWModel
weavingModel = (ASMAMWModel) amwModelHandler.loadModel(<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "SOMENAME", amwModelHandler.getMof(), "SOMEPATH");&nbsp;&nbsp; //
---&gt; SHOULD IT BE getAtl() ?? Doesn't work either<br>
</font><br>
The rest of the (meta)models, as ASMEMFModels: <br>
<br>
<font color="#009900" face="Courier New, Courier, monospace">(ASMEMFModel)
emfModelHandler.loadModel(...<br>
</font><br>
and then launch as:<br>
<br>
<font color="#009900">AtlLauncher.getDefault().launch(this.transfoResource, <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Collections.EMPTY_MAP, models,
Collections.EMPTY_MAP,<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Collections.EMPTY_LIST, Collections.EMPTY_MAP);<br>
<br>
<font color="#000000">Regretfully, when running this code, I get the
attached exception </font></font><font color="#009900"><font
color="#000000">(after some tranformation's "print-to-screen
debugging" comments).</font></font><br>
<font color="#009900"><font color="#000000">Any ideas on the probable
cause?, I guess I'm doing something wrong with the handlers and/or the
loading, but can't find any example code to base mine on.<br>
Thanks in advance and best regards,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; Juan Pedro<br>
<br>
</font></font><br>
</body>
</html>

--------------000103090702000907050506--

--------------050706060507030606020403
Content-Type: text/plain;
name="ProgrammAMWException.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="ProgrammAMWException.txt"

GRAVE: ****** BEGIN Stack Trace
GRAVE: exception:
GRAVE: null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:69)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:338)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:299)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:169)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:111)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:87)
at itecban.stras.sips.utils.AMWTransformationLauncher.iBuilderC ompSecureUML(AMWTransformationLauncher.java:205)
at itecban.stras.cheatsheets.sips.handlers.UML2iBuilderCommandH andler.execute(UML2iBuilderCommandHandler.java:53)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
at org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
at org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.NullPointerException
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getWovenAS MModel(ASMAMWModelElement.java:117)
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getReferre dElement(ASMAMWModelElement.java:192)
... 57 more
GRAVE: A.main() : ??#66 null
GRAVE: local variables = {self=weaving_tranfo_iBSecUML : ASMModule}
GRAVE: local stack = []
GRAVE: A.__matcher__() : ??#1 null
GRAVE: local variables = {self=weaving_tranfo_iBSecUML : ASMModule}
GRAVE: local stack = []
GRAVE: A.__matchnewAction() : ??#8 24:22-24:47
GRAVE: local variables = {attr=IN!FinancialDataDelete, self=weaving_tranfo_iBSecUML : ASMModule}
GRAVE: local stack = []
GRAVE: NativeOperation public static org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getReferre dElement(org.eclipse.m2m.atl.engine.vm.StackFrame,org.eclips e.m2m.atl.drivers.emf4atl.ASMEMFModelElement)
GRAVE: args = [IN!FinancialDataDelete]
GRAVE: ****** END Stack Trace
INFO: Execution terminated due to error (see launch configuration to allow continuation after errors).
GRAVE: null
java.lang.RuntimeException
at org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(SimpleDeb ugger.java:195)
at org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:95)
at org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Sta ckFrame.java:87)
at org.eclipse.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:77)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.invok e(ASMEMFModelElement.java:683)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:338)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:143)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(ASM OclAny.java:101)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(ASMOpera tion.java:240)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(ASMOperation .java:171)
at org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(ASMInterpreter.java:299)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:169)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:111)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(AtlLauncher.ja va:87)
at itecban.stras.sips.utils.AMWTransformationLauncher.iBuilderC ompSecureUML(AMWTransformationLauncher.java:205)
at itecban.stras.cheatsheets.sips.handlers.UML2iBuilderCommandH andler.execute(UML2iBuilderCommandHandler.java:53)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
at org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
at org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.m2m.atl.engine.vm.ClassNativeOperation.exec(Clas sNativeOperation.java:69)
... 52 more
Caused by: java.lang.NullPointerException
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getWovenAS MModel(ASMAMWModelElement.java:117)
at org.eclipse.gmt.weaver.amw4atl.ASMAMWModelElement.getReferre dElement(ASMAMWModelElement.java:192)
... 57 more
java.lang.NullPointerException
at itecban.stras.sips.utils.AMWTransformationLauncher.dispose(A MWTransformationLauncher.java:221)
at itecban.stras.sips.utils.AMWTransformationLauncher.iBuilderC ompSecureUML(AMWTransformationLauncher.java:211)
at itecban.stras.cheatsheets.sips.handlers.UML2iBuilderCommandH andler.execute(UML2iBuilderCommandHandler.java:53)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:281)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:619)
at org.eclipse.ui.menus.CommandContributionItem.access$10(Comma ndContributionItem.java:605)
at org.eclipse.ui.menus.CommandContributionItem$4.handleEvent(C ommandContributionItem.java:595)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3823)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3422)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2382)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:21 98)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:488)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)




--------------050706060507030606020403--
Re: Programmatically launching a composition: java.lang.reflect.InvocationTargetException [message #470302 is a reply to message #470301] Sun, 28 June 2009 18:04 Go to previous messageGo to next message
Juan Pedro Silva is currently offline Juan Pedro Silva
Messages: 258
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010607010603070704010503
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

*Update: *Launching it programmatically using the launch configuration
(by means of the DebugUITools.launch(..) method) also works fine.
I still believe I might be messing it up with the handlers
or something.

Juan Pedro Silva escribi
Re: Programmatically launching a composition: java.lang.reflect.InvocationTargetException [message #470305 is a reply to message #470301] Wed, 01 July 2009 20:32 Go to previous messageGo to next message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del Fabro
Messages: 84
Registered: July 2009
Member
Hello,

It is probably that the handler is not been registered correctly, so it
cannot find methods such as "getReferredElement", which are part of the
AMWModelHandler. If you do not call handler-specific methods, you may even
use only the standard EMFModelHandler.

You should get the handle this way:

AtlModelHandler modelHandler =
AtlModelHandler.getDefault(TransformationConstant.AMWModelHa ndler);

Check the code of package org.eclipse.gmt.weaver.transformation.util. It
has an example of transformations that are launched programmatically and
that have weaving models as input and as output.

http://dev.eclipse.org/viewsvn/index.cgi/plugins/trunk/org.e clipse.gmt.weaver.transformation/src/org/eclipse/gmt/weaver/ transformation/util/TransformationUtil.java?revision=12& root=Modeling_AMW&view=markup

Regards,

Marcos.
Re: Programmatically launching a composition: java.lang.reflect.InvocationTargetException [message #470309 is a reply to message #470305] Fri, 03 July 2009 15:35 Go to previous messageGo to next message
Juan Pedro Silva is currently offline Juan Pedro Silva
Messages: 258
Registered: July 2009
Senior Member
Thanks Marcos.
I won't be able to try just yet, because I may need to recompile my AMW
(my current version doesn't export the "transformation" package,
although I'm trying with just replacing the manifest file).
I was going to try to compile it for Galileo, but once again I face the
problem of the TCS dependency, and as ATL version changes quite a lot,
this time is not enough with the binary version you provided last time.
Regards,
Juan Pedro

Marcos Didonet Del Fabro escribió:
> Hello,
>
> It is probably that the handler is not been registered correctly, so
> it cannot find methods such as "getReferredElement", which are part of
> the AMWModelHandler. If you do not call handler-specific methods, you
> may even use only the standard EMFModelHandler.
>
> You should get the handle this way:
>
> AtlModelHandler modelHandler =
> AtlModelHandler.getDefault(TransformationConstant.AMWModelHa ndler);
>
> Check the code of package org.eclipse.gmt.weaver.transformation.util.
> It has an example of transformations that are launched
> programmatically and that have weaving models as input and as output.
>
> http://dev.eclipse.org/viewsvn/index.cgi/plugins/trunk/org.e clipse.gmt.weaver.transformation/src/org/eclipse/gmt/weaver/ transformation/util/TransformationUtil.java?revision=12& root=Modeling_AMW&view=markup
>
>
> Regards,
>
> Marcos.
>
Re: Programmatically launching a composition: java.lang.reflect.InvocationTargetException [message #470311 is a reply to message #470309] Mon, 06 July 2009 09:40 Go to previous message
Marcos Didonet Del Fabro is currently offline Marcos Didonet Del Fabro
Messages: 84
Registered: July 2009
Member
Hello,

actually, the link I sent is just an example of how we launched ATL
transformations that use the AMW model handler. You may use as a starting
point to implement your code.


Marcos.
Previous Topic:[AMW] weaving "n" metamodels and ATL transformation
Next Topic:ATLLauncher
Goto Forum:
  


Current Time: Sat Oct 25 14:52:12 GMT 2014

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

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