Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Problems with AcceleoService.doGenerate
[Acceleo] Problems with AcceleoService.doGenerate [message #527220] |
Wed, 14 April 2010 09:54  |
Eclipse User |
|
|
|
Hi all,
i want to invoke my m2t transformation from within my wizard. Therefore,
i tried to use AcceleoService with the following snippet:
final URI template =
getTemplateURI("de.fraunhofer.fokus.testing.m2t.tid.ttcn3", new
Path(" /de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN3Mo dule.emtl "));
ResourceSet mtlSet = new ResourceSetImpl();
final Resource mtlRessource = mtlSet.getResource(template0, true);
final Module module = (Module)mtlRessource.getContents().get(0);
AcceleoService.doGenerate(module,"generateTTCN3Module", model,
targetFolder.getLocation().toFile(), false, null);
The method getTemplateURI(...) was taken from the Acceleo UI Module
Project. Unfortunately, an exception arises while trying to load the
module. The following error trace is thrown:
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
at
org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
at
org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:275)
at
org.eclipse.ui.internal.progress.ProgressManager$4.run(Progr essManager.java:966)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at
org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:1001)
at
org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:976)
at
org.eclipse.ui.internal.progress.ProgressManager.run(Progres sManager.java:1182)
at
de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd.performFinish(TIDTestCaseGeneratorWizard.java:125)
at
org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:752)
at
org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:373)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
at
org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
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:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
at org.eclipse.jface.window.Window.open(Window.java:801)
at
org.eclipse.ui.internal.handlers.WizardHandler$Export.execut eHandler(WizardHandler.java:97)
at
org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
at
org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
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:241)
at
org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
at
org.eclipse.ui.internal.actions.CommandAction.run(CommandAct ion.java:171)
at
org.eclipse.ui.actions.ExportResourcesAction.run(ExportResou rcesAction.java:116)
at
org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEv ent(BaseSelectionListenerAction.java:168)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at
org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
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:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
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:194)
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:368)
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: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
Caused by:
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
(platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
3, 42)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at
de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:106)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
(platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
3, 42)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2590)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2421)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1299)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
at
org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
at
org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
at
org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
at
org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doLo ad(EMtlResourceImpl.java:59)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
... 3 more
What am i doing wrong?
Cheers,
Timothy
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527222 is a reply to message #527220] |
Wed, 14 April 2010 10:06   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------040104060708000105080804
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Hi Timothy,
You're trying to load this emtl file with Acceleo 3.0, yet it has been
compiled with an older version (thus package uri "http://*0.8.0*" where
it should be "http://*3.0*").
You'll need to recompile your template with Acceleo 3.0 before loading
it with this version.
Laurent Goubet
Obeo
Timothy Marc wrote:
> Hi all,
>
> i want to invoke my m2t transformation from within my wizard. Therefore,
> i tried to use AcceleoService with the following snippet:
>
> final URI template =
> getTemplateURI("de.fraunhofer.fokus.testing.m2t.tid.ttcn3", new
> Path(" /de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN3Mo dule.emtl "));
>
> ResourceSet mtlSet = new ResourceSetImpl();
> final Resource mtlRessource =
> mtlSet.getResource(template0, true);
> final Module module =
> (Module)mtlRessource.getContents().get(0);
>
> AcceleoService.doGenerate(module,"generateTTCN3Module", model,
> targetFolder.getLocation().toFile(), false, null);
>
>
> The method getTemplateURI(...) was taken from the Acceleo UI Module
> Project. Unfortunately, an exception arises while trying to load the
> module. The following error trace is thrown:
>
> java.lang.reflect.InvocationTargetException
> at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
> at
> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
>
> at
> org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:275)
>
> at
> org.eclipse.ui.internal.progress.ProgressManager$4.run(Progr essManager.java:966)
>
> at
> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at
> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:1001)
>
> at
> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:976)
>
> at
> org.eclipse.ui.internal.progress.ProgressManager.run(Progres sManager.java:1182)
>
> at
> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd.performFinish(TIDTestCaseGeneratorWizard.java:125)
>
> at
> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:752)
> at
> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:373)
> at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
> 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:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
> at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
> at org.eclipse.jface.window.Window.open(Window.java:801)
> at
> org.eclipse.ui.internal.handlers.WizardHandler$Export.execut eHandler(WizardHandler.java:97)
>
> at
> org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
>
> at
> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
>
> 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:241)
>
> at
> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
>
> at
> org.eclipse.ui.internal.actions.CommandAction.run(CommandAct ion.java:171)
> at
> org.eclipse.ui.actions.ExportResourcesAction.run(ExportResou rcesAction.java:116)
>
> at
> org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEv ent(BaseSelectionListenerAction.java:168)
>
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
>
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
>
> at
> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
>
> 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:3880)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
> 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:194)
>
> 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:368)
>
> 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: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
> Caused by:
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
> 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
> 3, 42)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>
> at
> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:106)
>
> at
> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>
> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
> with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
> 3, 42)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2590)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2421)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1299)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
>
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
> at
> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown Source)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
> Source)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
> Source)
> at javax.xml.parsers.SAXParser.parse(Unknown Source)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>
> at
> org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doLo ad(EMtlResourceImpl.java:59)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>
> ... 3 more
>
>
> What am i doing wrong?
>
> Cheers,
>
> Timothy
>
--------------040104060708000105080804
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard
--------------040104060708000105080804--
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527373 is a reply to message #527222] |
Thu, 15 April 2010 01:35   |
Eclipse User |
|
|
|
Hi Laurent,
well, if i would have done this, i think i would have been able to
interprete the exception by myself, but actually, i'm compiling and
running with Acceleo 0.8.1 as part of the Galileo Modeling Distribution
SR1. Only 0.8.1 is available in my distribution, that's why i didn't
really understand why http://www.eclipse.org/acceleo/mtl/0.8.0 was not
found, since i didn't work with 0.8.0!!
Cheers,
Timothy
Laurent Goubet schrieb:
> Hi Timothy,
>
> You're trying to load this emtl file with Acceleo 3.0, yet it has been
> compiled with an older version (thus package uri "http://*0.8.0*" where
> it should be "http://*3.0*").
>
> You'll need to recompile your template with Acceleo 3.0 before loading
> it with this version.
>
> Laurent Goubet
> Obeo
>
> Timothy Marc wrote:
>> Hi all,
>>
>> i want to invoke my m2t transformation from within my wizard.
>> Therefore, i tried to use AcceleoService with the following snippet:
>>
>> final URI template =
>> getTemplateURI("de.fraunhofer.fokus.testing.m2t.tid.ttcn3", new
>> Path(" /de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN3Mo dule.emtl "));
>>
>> ResourceSet mtlSet = new ResourceSetImpl();
>> final Resource mtlRessource =
>> mtlSet.getResource(template0, true);
>> final Module module =
>> (Module)mtlRessource.getContents().get(0);
>>
>> AcceleoService.doGenerate(module,"generateTTCN3Module", model,
>> targetFolder.getLocation().toFile(), false, null);
>>
>>
>> The method getTemplateURI(...) was taken from the Acceleo UI Module
>> Project. Unfortunately, an exception arises while trying to load the
>> module. The following error trace is thrown:
>>
>> java.lang.reflect.InvocationTargetException
>> at
>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
>> at
>> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
>>
>> at
>> org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:275)
>>
>> at
>> org.eclipse.ui.internal.progress.ProgressManager$4.run(Progr essManager.java:966)
>>
>> at
>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>> at
>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:1001)
>>
>> at
>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:976)
>>
>> at
>> org.eclipse.ui.internal.progress.ProgressManager.run(Progres sManager.java:1182)
>>
>> at
>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd.performFinish(TIDTestCaseGeneratorWizard.java:125)
>>
>> at
>> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:752)
>>
>> at
>> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:373)
>>
>> at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
>> at
>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
>> 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:3880)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>> at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
>> at org.eclipse.jface.window.Window.open(Window.java:801)
>> at
>> org.eclipse.ui.internal.handlers.WizardHandler$Export.execut eHandler(WizardHandler.java:97)
>>
>> at
>> org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
>>
>> at
>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
>>
>> 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:241)
>>
>> at
>> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
>>
>> at
>> org.eclipse.ui.internal.actions.CommandAction.run(CommandAct ion.java:171)
>> at
>> org.eclipse.ui.actions.ExportResourcesAction.run(ExportResou rcesAction.java:116)
>>
>> at
>> org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEv ent(BaseSelectionListenerAction.java:168)
>>
>> at
>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
>>
>> at
>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
>>
>> at
>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
>>
>> 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:3880)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>> at
>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>> at
>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>
>> at
>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>>
>> 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:194)
>>
>> 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:368)
>>
>> 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: 559)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>> Caused by:
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
>> 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>> 3, 42)
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>
>> at
>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:106)
>>
>> at
>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>
>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
>> with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>> 3, 42)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2590)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2421)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1299)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>>
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
>>
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>> Source)
>> at
>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>> Source)
>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>> at
>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>
>> at
>> org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doLo ad(EMtlResourceImpl.java:59)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>>
>> ... 3 more
>>
>>
>> What am i doing wrong?
>>
>> Cheers,
>>
>> Timothy
>>
>
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527413 is a reply to message #527373] |
Thu, 15 April 2010 04:02   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------030600010200040206080907
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Hi Timothy,
Sorry, didn't think you were still using version 0.8.* :). The metamodel
NsURI had been set with version "0.8.0" when we started the project, and
never changed before 3.0M6 where we updated this number to "3.0". It
shouldn't change more before breaking changes are made.
That aside, this is not the problem you encounter. It would seem the
package hasn't been registered in the EMF registry in your case ...
which shouldn't be the case if you run this code in Eclipse.
Anyway, what you need is this line before the resource loading :
EPackage.Registry.INSTANCE.put(MtlPackage.eNS_URI, MtlPackage.eINSTANCE);
Why this registration isn't taken care of by OSGi in your case, I don't
really understand. Are you running this code in standalone?
Laurent Goubet
Obeo
Timothy Marc wrote:
> Hi Laurent,
>
> well, if i would have done this, i think i would have been able to
> interprete the exception by myself, but actually, i'm compiling and
> running with Acceleo 0.8.1 as part of the Galileo Modeling Distribution
> SR1. Only 0.8.1 is available in my distribution, that's why i didn't
> really understand why http://www.eclipse.org/acceleo/mtl/0.8.0 was not
> found, since i didn't work with 0.8.0!!
>
> Cheers,
> Timothy
>
>
> Laurent Goubet schrieb:
>> Hi Timothy,
>>
>> You're trying to load this emtl file with Acceleo 3.0, yet it has been
>> compiled with an older version (thus package uri "http://*0.8.0*"
>> where it should be "http://*3.0*").
>>
>> You'll need to recompile your template with Acceleo 3.0 before loading
>> it with this version.
>>
>> Laurent Goubet
>> Obeo
>>
>> Timothy Marc wrote:
>>> Hi all,
>>>
>>> i want to invoke my m2t transformation from within my wizard.
>>> Therefore, i tried to use AcceleoService with the following snippet:
>>>
>>> final URI template =
>>> getTemplateURI("de.fraunhofer.fokus.testing.m2t.tid.ttcn3", new
>>> Path(" /de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN3Mo dule.emtl "));
>>>
>>> ResourceSet mtlSet = new ResourceSetImpl();
>>> final Resource mtlRessource =
>>> mtlSet.getResource(template0, true);
>>> final Module module =
>>> (Module)mtlRessource.getContents().get(0);
>>>
>>> AcceleoService.doGenerate(module,"generateTTCN3Module", model,
>>> targetFolder.getLocation().toFile(), false, null);
>>>
>>>
>>> The method getTemplateURI(...) was taken from the Acceleo UI Module
>>> Project. Unfortunately, an exception arises while trying to load the
>>> module. The following error trace is thrown:
>>>
>>> java.lang.reflect.InvocationTargetException
>>> at
>>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
>>> at
>>> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
>>>
>>> at
>>> org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:275)
>>>
>>> at
>>> org.eclipse.ui.internal.progress.ProgressManager$4.run(Progr essManager.java:966)
>>>
>>> at
>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>> at
>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:1001)
>>>
>>> at
>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:976)
>>>
>>> at
>>> org.eclipse.ui.internal.progress.ProgressManager.run(Progres sManager.java:1182)
>>>
>>> at
>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd.performFinish(TIDTestCaseGeneratorWizard.java:125)
>>>
>>> at
>>> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:752)
>>>
>>> at
>>> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:373)
>>>
>>> at
>>> org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
>>> at
>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
>>>
>>> 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:3880)
>>> at
>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>> at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
>>> at org.eclipse.jface.window.Window.open(Window.java:801)
>>> at
>>> org.eclipse.ui.internal.handlers.WizardHandler$Export.execut eHandler(WizardHandler.java:97)
>>>
>>> at
>>> org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
>>>
>>> at
>>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
>>>
>>> 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:241)
>>>
>>> at
>>> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
>>>
>>> at
>>> org.eclipse.ui.internal.actions.CommandAction.run(CommandAct ion.java:171)
>>>
>>> at
>>> org.eclipse.ui.actions.ExportResourcesAction.run(ExportResou rcesAction.java:116)
>>>
>>> at
>>> org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEv ent(BaseSelectionListenerAction.java:168)
>>>
>>> at
>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
>>>
>>> at
>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
>>>
>>> at
>>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
>>>
>>> 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:3880)
>>> at
>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>> at
>>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>>> at
>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>>
>>> at
>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>>>
>>> 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:194)
>>>
>>> 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:368)
>>>
>>> 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: 559)
>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>>> Caused by:
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
>>> 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>> 3, 42)
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>>
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>>
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>>
>>> at
>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:106)
>>>
>>> at
>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>>
>>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException:
>>> Package with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not
>>> found.
>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>> 3, 42)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2590)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2421)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1299)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>>>
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
>>>
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>> Source)
>>> at
>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>> Source)
>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>>> at
>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>
>>> at
>>> org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doLo ad(EMtlResourceImpl.java:59)
>>>
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
>>>
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>>>
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>>>
>>> at
>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>>>
>>> ... 3 more
>>>
>>>
>>> What am i doing wrong?
>>>
>>> Cheers,
>>>
>>> Timothy
>>>
>>
--------------030600010200040206080907
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard
--------------030600010200040206080907--
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527431 is a reply to message #527413] |
Thu, 15 April 2010 04:40   |
Eclipse User |
|
|
|
Hi Laurent,
i figured out, that the exception was thrown by the EEF 0.8.0
(Incubation) project, i had installed manually. After uninstalling it,
the generation works with 0.8.1.
Well, one more question concerning update sites an Acceleo: I bundle the
generator project (0.8.1) with an update site and install the whole
update site in another distribution. Is this what you call headless
build? Because the execution of the generator fails with a
NUllPointerException. But how do i install a generator project instead?
I need an update site urgently for my whole project, including the
generator project.
Cheers,
Timothy
Laurent Goubet schrieb:
> Hi Timothy,
>
> Sorry, didn't think you were still using version 0.8.* :). The metamodel
> NsURI had been set with version "0.8.0" when we started the project, and
> never changed before 3.0M6 where we updated this number to "3.0". It
> shouldn't change more before breaking changes are made.
>
> That aside, this is not the problem you encounter. It would seem the
> package hasn't been registered in the EMF registry in your case ...
> which shouldn't be the case if you run this code in Eclipse.
>
> Anyway, what you need is this line before the resource loading :
> EPackage.Registry.INSTANCE.put(MtlPackage.eNS_URI, MtlPackage.eINSTANCE);
>
> Why this registration isn't taken care of by OSGi in your case, I don't
> really understand. Are you running this code in standalone?
>
> Laurent Goubet
> Obeo
>
> Timothy Marc wrote:
>> Hi Laurent,
>>
>> well, if i would have done this, i think i would have been able to
>> interprete the exception by myself, but actually, i'm compiling and
>> running with Acceleo 0.8.1 as part of the Galileo Modeling
>> Distribution SR1. Only 0.8.1 is available in my distribution, that's
>> why i didn't really understand why
>> http://www.eclipse.org/acceleo/mtl/0.8.0 was not found, since i didn't
>> work with 0.8.0!!
>>
>> Cheers,
>> Timothy
>>
>>
>> Laurent Goubet schrieb:
>>> Hi Timothy,
>>>
>>> You're trying to load this emtl file with Acceleo 3.0, yet it has
>>> been compiled with an older version (thus package uri
>>> "http://*0.8.0*" where it should be "http://*3.0*").
>>>
>>> You'll need to recompile your template with Acceleo 3.0 before
>>> loading it with this version.
>>>
>>> Laurent Goubet
>>> Obeo
>>>
>>> Timothy Marc wrote:
>>>> Hi all,
>>>>
>>>> i want to invoke my m2t transformation from within my wizard.
>>>> Therefore, i tried to use AcceleoService with the following snippet:
>>>>
>>>> final URI template =
>>>> getTemplateURI("de.fraunhofer.fokus.testing.m2t.tid.ttcn3", new
>>>> Path(" /de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN3Mo dule.emtl "));
>>>>
>>>> ResourceSet mtlSet = new ResourceSetImpl();
>>>> final Resource mtlRessource =
>>>> mtlSet.getResource(template0, true);
>>>> final Module module =
>>>> (Module)mtlRessource.getContents().get(0);
>>>>
>>>> AcceleoService.doGenerate(module,"generateTTCN3Module", model,
>>>> targetFolder.getLocation().toFile(), false, null);
>>>>
>>>>
>>>> The method getTemplateURI(...) was taken from the Acceleo UI Module
>>>> Project. Unfortunately, an exception arises while trying to load the
>>>> module. The following error trace is thrown:
>>>>
>>>> java.lang.reflect.InvocationTargetException
>>>> at
>>>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
>>>> at
>>>> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:275)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.progress.ProgressManager$4.run(Progr essManager.java:966)
>>>>
>>>> at
>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>>> at
>>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:1001)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:976)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.progress.ProgressManager.run(Progres sManager.java:1182)
>>>>
>>>> at
>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd.performFinish(TIDTestCaseGeneratorWizard.java:125)
>>>>
>>>> at
>>>> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:752)
>>>>
>>>> at
>>>> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:373)
>>>>
>>>> at
>>>> org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
>>>> at
>>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
>>>>
>>>> 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:3880)
>>>> at
>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>>> at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
>>>> at org.eclipse.jface.window.Window.open(Window.java:801)
>>>> at
>>>> org.eclipse.ui.internal.handlers.WizardHandler$Export.execut eHandler(WizardHandler.java:97)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
>>>>
>>>> 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:241)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.actions.CommandAction.run(CommandAct ion.java:171)
>>>>
>>>> at
>>>> org.eclipse.ui.actions.ExportResourcesAction.run(ExportResou rcesAction.java:116)
>>>>
>>>> at
>>>> org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEv ent(BaseSelectionListenerAction.java:168)
>>>>
>>>> at
>>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
>>>>
>>>> at
>>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
>>>>
>>>> at
>>>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
>>>>
>>>> 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:3880)
>>>> at
>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>>> at
>>>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>>>> at
>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>>>
>>>> at
>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>>>>
>>>> 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:194)
>>>>
>>>> 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:368)
>>>>
>>>> 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: 559)
>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>>>> Caused by:
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri
>>>> 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
>>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>>> 3, 42)
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>>>
>>>> at
>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:106)
>>>>
>>>> at
>>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>>>
>>>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException:
>>>> Package with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not
>>>> found.
>>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>>> 3, 42)
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2590)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2421)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1299)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
>>>>
>>>> at
>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>>> Source)
>>>> at
>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>>> Source)
>>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>>>> at
>>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>>
>>>> at
>>>> org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doLo ad(EMtlResourceImpl.java:59)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>>>>
>>>> ... 3 more
>>>>
>>>>
>>>> What am i doing wrong?
>>>>
>>>> Cheers,
>>>>
>>>> Timothy
>>>>
>>>
>
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527451 is a reply to message #527431] |
Thu, 15 April 2010 06:01   |
Eclipse User |
|
|
|
Hi Timothy,
comments below :
Timothy Marc a écrit :
> Hi Laurent,
>
> i figured out, that the exception was thrown by the EEF 0.8.0
> (Incubation) project, i had installed manually. After uninstalling it,
> the generation works with 0.8.1.
EEF M6 requires Acceleo 3.0.0M6, so it is the cause of your problem.
if you want to try EEF with your actual installation use EEF M5.
>
> Well, one more question concerning update sites an Acceleo: I bundle the
> generator project (0.8.1) with an update site and install the whole
> update site in another distribution. Is this what you call headless
> build? Because the execution of the generator fails with a
> NUllPointerException. But how do i install a generator project instead?
> I need an update site urgently for my whole project, including the
> generator project.
You have to install Aceeleo, too in the another distribution.
Can you provide more stack trace for your NPE ?
>
> Cheers,
> Timothy
>
> Laurent Goubet schrieb:
>> Hi Timothy,
>>
>> Sorry, didn't think you were still using version 0.8.* :). The
>> metamodel NsURI had been set with version "0.8.0" when we started the
>> project, and never changed before 3.0M6 where we updated this number
>> to "3.0". It shouldn't change more before breaking changes are made.
>>
>> That aside, this is not the problem you encounter. It would seem the
>> package hasn't been registered in the EMF registry in your case ...
>> which shouldn't be the case if you run this code in Eclipse.
>>
>> Anyway, what you need is this line before the resource loading :
>> EPackage.Registry.INSTANCE.put(MtlPackage.eNS_URI, MtlPackage.eINSTANCE);
>>
>> Why this registration isn't taken care of by OSGi in your case, I
>> don't really understand. Are you running this code in standalone?
>>
>> Laurent Goubet
>> Obeo
>>
>> Timothy Marc wrote:
>>> Hi Laurent,
>>>
>>> well, if i would have done this, i think i would have been able to
>>> interprete the exception by myself, but actually, i'm compiling and
>>> running with Acceleo 0.8.1 as part of the Galileo Modeling
>>> Distribution SR1. Only 0.8.1 is available in my distribution, that's
>>> why i didn't really understand why
>>> http://www.eclipse.org/acceleo/mtl/0.8.0 was not found, since i
>>> didn't work with 0.8.0!!
>>>
>>> Cheers,
>>> Timothy
>>>
>>>
>>> Laurent Goubet schrieb:
>>>> Hi Timothy,
>>>>
>>>> You're trying to load this emtl file with Acceleo 3.0, yet it has
>>>> been compiled with an older version (thus package uri
>>>> "http://*0.8.0*" where it should be "http://*3.0*").
>>>>
>>>> You'll need to recompile your template with Acceleo 3.0 before
>>>> loading it with this version.
>>>>
>>>> Laurent Goubet
>>>> Obeo
>>>>
>>>> Timothy Marc wrote:
>>>>> Hi all,
>>>>>
>>>>> i want to invoke my m2t transformation from within my wizard.
>>>>> Therefore, i tried to use AcceleoService with the following snippet:
>>>>>
>>>>> final URI template =
>>>>> getTemplateURI("de.fraunhofer.fokus.testing.m2t.tid.ttcn3", new
>>>>> Path(" /de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN3Mo dule.emtl "));
>>>>>
>>>>> ResourceSet mtlSet = new ResourceSetImpl();
>>>>> final Resource mtlRessource =
>>>>> mtlSet.getResource(template0, true);
>>>>> final Module module =
>>>>> (Module)mtlRessource.getContents().get(0);
>>>>>
>>>>> AcceleoService.doGenerate(module,"generateTTCN3Module", model,
>>>>> targetFolder.getLocation().toFile(), false, null);
>>>>>
>>>>>
>>>>> The method getTemplateURI(...) was taken from the Acceleo UI Module
>>>>> Project. Unfortunately, an exception arises while trying to load
>>>>> the module. The following error trace is thrown:
>>>>>
>>>>> java.lang.reflect.InvocationTargetException
>>>>> at
>>>>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
>>>>> at
>>>>> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:275)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.internal.progress.ProgressManager$4.run(Progr essManager.java:966)
>>>>>
>>>>> at
>>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>>>> at
>>>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:1001)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:976)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.internal.progress.ProgressManager.run(Progres sManager.java:1182)
>>>>>
>>>>> at
>>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd.performFinish(TIDTestCaseGeneratorWizard.java:125)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:752)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:373)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
>>>>> at
>>>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
>>>>>
>>>>> 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:3880)
>>>>> at
>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>>>> at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
>>>>> at org.eclipse.jface.window.Window.open(Window.java:801)
>>>>> at
>>>>> org.eclipse.ui.internal.handlers.WizardHandler$Export.execut eHandler(WizardHandler.java:97)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
>>>>>
>>>>> 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:241)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.internal.actions.CommandAction.run(CommandAct ion.java:171)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.actions.ExportResourcesAction.run(ExportResou rcesAction.java:116)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEv ent(BaseSelectionListenerAction.java:168)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
>>>>>
>>>>> 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:3880)
>>>>> at
>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>>>> at
>>>>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>>>>> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>>>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>>>>> at
>>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>>>>
>>>>> at
>>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>>>>>
>>>>> 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:194)
>>>>>
>>>>> 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:368)
>>>>>
>>>>> 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: 559)
>>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>>>>> Caused by:
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>>>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with
>>>>> uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
>>>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>>>> 3, 42)
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>>>>
>>>>> at
>>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:106)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>>>>
>>>>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException:
>>>>> Package with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not
>>>>> found.
>>>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>>>> 3, 42)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2590)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2421)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1299)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
>>>>>
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>>>> Source)
>>>>> at
>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>>>> Source)
>>>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>>>>> at
>>>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>>>
>>>>> at
>>>>> org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doLo ad(EMtlResourceImpl.java:59)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>>>>>
>>>>> ... 3 more
>>>>>
>>>>>
>>>>> What am i doing wrong?
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Timothy
>>>>>
>>>>
>>
--
Cheers,
Stéphane Bouchet, OBEO
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527504 is a reply to message #527451] |
Thu, 15 April 2010 09:23   |
Eclipse User |
|
|
|
Stephane,
of course, Acceleo in the same version is installed in the other
distribution ;-)
Here is the stack trace:
java.io.IOException: 'generateTTCN3Module.emtl' not found
at
de.fraunhofer.fokus.testing.m2t.ttcn3.files.GenerateTTCN3Mod ule. <init>(GenerateTTCN3Module.java:126)
at
de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:112)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
As i mentioned in a post several month ago, as long as i invoke the
transformation from within my test environment by starting a new
instance of my development environment, it works perfectly. After
creating an update site and installing all the tools i use in a new
eclipse environment it fails. Both distributions are non-modified
galileo SR2 modeling releases except of udating to Acceleo MTL 3.0.0.
So, it must be somehow possible to include a Acceleo transformation into
an update site, mustn't it?
Thanks again
Timothy
Stéphane Bouchet schrieb:
> Hi Timothy,
>
> comments below :
>
> Timothy Marc a écrit :
>> Hi Laurent,
>>
>> i figured out, that the exception was thrown by the EEF 0.8.0
>> (Incubation) project, i had installed manually. After uninstalling it,
>> the generation works with 0.8.1.
>
>
> EEF M6 requires Acceleo 3.0.0M6, so it is the cause of your problem.
> if you want to try EEF with your actual installation use EEF M5.
>
>
>>
>> Well, one more question concerning update sites an Acceleo: I bundle
>> the generator project (0.8.1) with an update site and install the
>> whole update site in another distribution. Is this what you call
>> headless build? Because the execution of the generator fails with a
>> NUllPointerException. But how do i install a generator project
>> instead? I need an update site urgently for my whole project,
>> including the generator project.
>
> You have to install Aceeleo, too in the another distribution.
> Can you provide more stack trace for your NPE ?
>
>
>>
>> Cheers,
>> Timothy
>>
>> Laurent Goubet schrieb:
>>> Hi Timothy,
>>>
>>> Sorry, didn't think you were still using version 0.8.* :). The
>>> metamodel NsURI had been set with version "0.8.0" when we started the
>>> project, and never changed before 3.0M6 where we updated this number
>>> to "3.0". It shouldn't change more before breaking changes are made.
>>>
>>> That aside, this is not the problem you encounter. It would seem the
>>> package hasn't been registered in the EMF registry in your case ...
>>> which shouldn't be the case if you run this code in Eclipse.
>>>
>>> Anyway, what you need is this line before the resource loading :
>>> EPackage.Registry.INSTANCE.put(MtlPackage.eNS_URI,
>>> MtlPackage.eINSTANCE);
>>>
>>> Why this registration isn't taken care of by OSGi in your case, I
>>> don't really understand. Are you running this code in standalone?
>>>
>>> Laurent Goubet
>>> Obeo
>>>
>>> Timothy Marc wrote:
>>>> Hi Laurent,
>>>>
>>>> well, if i would have done this, i think i would have been able to
>>>> interprete the exception by myself, but actually, i'm compiling and
>>>> running with Acceleo 0.8.1 as part of the Galileo Modeling
>>>> Distribution SR1. Only 0.8.1 is available in my distribution, that's
>>>> why i didn't really understand why
>>>> http://www.eclipse.org/acceleo/mtl/0.8.0 was not found, since i
>>>> didn't work with 0.8.0!!
>>>>
>>>> Cheers,
>>>> Timothy
>>>>
>>>>
>>>> Laurent Goubet schrieb:
>>>>> Hi Timothy,
>>>>>
>>>>> You're trying to load this emtl file with Acceleo 3.0, yet it has
>>>>> been compiled with an older version (thus package uri
>>>>> "http://*0.8.0*" where it should be "http://*3.0*").
>>>>>
>>>>> You'll need to recompile your template with Acceleo 3.0 before
>>>>> loading it with this version.
>>>>>
>>>>> Laurent Goubet
>>>>> Obeo
>>>>>
>>>>> Timothy Marc wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> i want to invoke my m2t transformation from within my wizard.
>>>>>> Therefore, i tried to use AcceleoService with the following snippet:
>>>>>>
>>>>>> final URI template =
>>>>>> getTemplateURI("de.fraunhofer.fokus.testing.m2t.tid.ttcn3", new
>>>>>> Path(" /de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN3Mo dule.emtl "));
>>>>>>
>>>>>> ResourceSet mtlSet = new ResourceSetImpl();
>>>>>> final Resource mtlRessource =
>>>>>> mtlSet.getResource(template0, true);
>>>>>> final Module module =
>>>>>> (Module)mtlRessource.getContents().get(0);
>>>>>>
>>>>>> AcceleoService.doGenerate(module,"generateTTCN3Module", model,
>>>>>> targetFolder.getLocation().toFile(), false, null);
>>>>>>
>>>>>>
>>>>>> The method getTemplateURI(...) was taken from the Acceleo UI
>>>>>> Module Project. Unfortunately, an exception arises while trying to
>>>>>> load the module. The following error trace is thrown:
>>>>>>
>>>>>> java.lang.reflect.InvocationTargetException
>>>>>> at
>>>>>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
>>>>>> at
>>>>>> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:275)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.internal.progress.ProgressManager$4.run(Progr essManager.java:966)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>>>>> at
>>>>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:1001)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:976)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.internal.progress.ProgressManager.run(Progres sManager.java:1182)
>>>>>>
>>>>>> at
>>>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd.performFinish(TIDTestCaseGeneratorWizard.java:125)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:752)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:373)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
>>>>>> at
>>>>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
>>>>>>
>>>>>> 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:3880)
>>>>>> at
>>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>>>>> at org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
>>>>>> at org.eclipse.jface.window.Window.open(Window.java:801)
>>>>>> at
>>>>>> org.eclipse.ui.internal.handlers.WizardHandler$Export.execut eHandler(WizardHandler.java:97)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
>>>>>>
>>>>>> 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:241)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.internal.actions.CommandAction.run(CommandAct ion.java:171)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.actions.ExportResourcesAction.run(ExportResou rcesAction.java:116)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEv ent(BaseSelectionListenerAction.java:168)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
>>>>>>
>>>>>> 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:3880)
>>>>>> at
>>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>>>>> at
>>>>>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>>>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>>>>>> at
>>>>>> org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>>>>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>>>>>> at
>>>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>>>>>>
>>>>>> 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:194)
>>>>>>
>>>>>> 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:368)
>>>>>>
>>>>>> 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: 559)
>>>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>>>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>>>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>>>>>> Caused by:
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>>>>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with
>>>>>> uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
>>>>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>>>>> 3, 42)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>>>>>
>>>>>> at
>>>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:106)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>>>>>
>>>>>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException:
>>>>>> Package with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not
>>>>>> found.
>>>>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>>>>> 3, 42)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2590)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2421)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1299)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
>>>>>>
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>>>>> Source)
>>>>>> at
>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>>>>> Source)
>>>>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>>>>>> at
>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doLo ad(EMtlResourceImpl.java:59)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>>>>>>
>>>>>> ... 3 more
>>>>>>
>>>>>>
>>>>>> What am i doing wrong?
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Timothy
>>>>>>
>>>>>
>>>
>
>
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527550 is a reply to message #527504] |
Thu, 15 April 2010 10:59   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------030506060706050106020406
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Timothy,
That's a problem with JDT (specifically, the Java builder) removing all
files that are not either ".java" or ".class" from the "bin" folder ...
which turns out to also contain our ".emtl" compiled files.
This is fixed with Acceleo 3.0 as we now recompile emtl files on-the-fly
when they're nowhere to be found and the generation is run from within
Eclipse (which is your case). Acceleo 0.8 didn't sport this feature and
you then cannot accomplish what you're trying with the version.
Be it Acceleo 0.8.1 or Acceleo 3.0, none can recompile things on the fly
when generations are run in standalone ; in which case you need to
export jars that contain the compiled ".emtl" files.
That said, there is no reason no to switch to 3.0 instead of 0.8 as we
still maintain compatibility with Eclipse 3.4 and 3.5.
Laurent Goubet
Obeo
Timothy Marc wrote:
> Stephane,
>
> of course, Acceleo in the same version is installed in the other
> distribution ;-)
>
> Here is the stack trace:
>
> java.io.IOException: 'generateTTCN3Module.emtl' not found
> at
> de.fraunhofer.fokus.testing.m2t.ttcn3.files.GenerateTTCN3Mod ule. <init>(GenerateTTCN3Module.java:126)
>
> at
> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:112)
>
> at
> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>
>
>
> As i mentioned in a post several month ago, as long as i invoke the
> transformation from within my test environment by starting a new
> instance of my development environment, it works perfectly. After
> creating an update site and installing all the tools i use in a new
> eclipse environment it fails. Both distributions are non-modified
> galileo SR2 modeling releases except of udating to Acceleo MTL 3.0.0.
>
> So, it must be somehow possible to include a Acceleo transformation into
> an update site, mustn't it?
>
> Thanks again
> Timothy
>
> St
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527678 is a reply to message #527550] |
Fri, 16 April 2010 02:20   |
Eclipse User |
|
|
|
Hi Laurent,
but it is still interesting that, for the latest test, i used Acceleo
3.0, which had the same problems obviously. The stack trace i've shown
beforehand was produced by Acceleo 3.0!
As you said, you recompile them on thy fly, even if the generation is
called programmatically? What i do is, i integrate the invokation of the
generation into an export wizard!
Cheers Timothy
Laurent Goubet schrieb:
> Timothy,
>
> That's a problem with JDT (specifically, the Java builder) removing all
> files that are not either ".java" or ".class" from the "bin" folder ...
> which turns out to also contain our ".emtl" compiled files.
>
> This is fixed with Acceleo 3.0 as we now recompile emtl files on-the-fly
> when they're nowhere to be found and the generation is run from within
> Eclipse (which is your case). Acceleo 0.8 didn't sport this feature and
> you then cannot accomplish what you're trying with the version.
>
> Be it Acceleo 0.8.1 or Acceleo 3.0, none can recompile things on the fly
> when generations are run in standalone ; in which case you need to
> export jars that contain the compiled ".emtl" files.
>
> That said, there is no reason no to switch to 3.0 instead of 0.8 as we
> still maintain compatibility with Eclipse 3.4 and 3.5.
>
> Laurent Goubet
> Obeo
>
> Timothy Marc wrote:
>> Stephane,
>>
>> of course, Acceleo in the same version is installed in the other
>> distribution ;-)
>>
>> Here is the stack trace:
>>
>> java.io.IOException: 'generateTTCN3Module.emtl' not found
>> at
>> de.fraunhofer.fokus.testing.m2t.ttcn3.files.GenerateTTCN3Mod ule. <init>(GenerateTTCN3Module.java:126)
>>
>> at
>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:112)
>>
>> at
>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>
>>
>>
>> As i mentioned in a post several month ago, as long as i invoke the
>> transformation from within my test environment by starting a new
>> instance of my development environment, it works perfectly. After
>> creating an update site and installing all the tools i use in a new
>> eclipse environment it fails. Both distributions are non-modified
>> galileo SR2 modeling releases except of udating to Acceleo MTL 3.0.0.
>>
>> So, it must be somehow possible to include a Acceleo transformation
>> into an update site, mustn't it?
>>
>> Thanks again
>> Timothy
>>
>> Stéphane Bouchet schrieb:
>>> Hi Timothy,
>>>
>>> comments below :
>>>
>>> Timothy Marc a écrit :
>>>> Hi Laurent,
>>>>
>>>> i figured out, that the exception was thrown by the EEF 0.8.0
>>>> (Incubation) project, i had installed manually. After uninstalling
>>>> it, the generation works with 0.8.1.
>>>
>>>
>>> EEF M6 requires Acceleo 3.0.0M6, so it is the cause of your problem.
>>> if you want to try EEF with your actual installation use EEF M5.
>>>
>>>
>>>>
>>>> Well, one more question concerning update sites an Acceleo: I bundle
>>>> the generator project (0.8.1) with an update site and install the
>>>> whole update site in another distribution. Is this what you call
>>>> headless build? Because the execution of the generator fails with a
>>>> NUllPointerException. But how do i install a generator project
>>>> instead? I need an update site urgently for my whole project,
>>>> including the generator project.
>>>
>>> You have to install Aceeleo, too in the another distribution.
>>> Can you provide more stack trace for your NPE ?
>>>
>>>
>>>>
>>>> Cheers,
>>>> Timothy
>>>>
>>>> Laurent Goubet schrieb:
>>>>> Hi Timothy,
>>>>>
>>>>> Sorry, didn't think you were still using version 0.8.* :). The
>>>>> metamodel NsURI had been set with version "0.8.0" when we started
>>>>> the project, and never changed before 3.0M6 where we updated this
>>>>> number to "3.0". It shouldn't change more before breaking changes
>>>>> are made.
>>>>>
>>>>> That aside, this is not the problem you encounter. It would seem
>>>>> the package hasn't been registered in the EMF registry in your case
>>>>> ... which shouldn't be the case if you run this code in Eclipse.
>>>>>
>>>>> Anyway, what you need is this line before the resource loading :
>>>>> EPackage.Registry.INSTANCE.put(MtlPackage.eNS_URI,
>>>>> MtlPackage.eINSTANCE);
>>>>>
>>>>> Why this registration isn't taken care of by OSGi in your case, I
>>>>> don't really understand. Are you running this code in standalone?
>>>>>
>>>>> Laurent Goubet
>>>>> Obeo
>>>>>
>>>>> Timothy Marc wrote:
>>>>>> Hi Laurent,
>>>>>>
>>>>>> well, if i would have done this, i think i would have been able to
>>>>>> interprete the exception by myself, but actually, i'm compiling
>>>>>> and running with Acceleo 0.8.1 as part of the Galileo Modeling
>>>>>> Distribution SR1. Only 0.8.1 is available in my distribution,
>>>>>> that's why i didn't really understand why
>>>>>> http://www.eclipse.org/acceleo/mtl/0.8.0 was not found, since i
>>>>>> didn't work with 0.8.0!!
>>>>>>
>>>>>> Cheers,
>>>>>> Timothy
>>>>>>
>>>>>>
>>>>>> Laurent Goubet schrieb:
>>>>>>> Hi Timothy,
>>>>>>>
>>>>>>> You're trying to load this emtl file with Acceleo 3.0, yet it has
>>>>>>> been compiled with an older version (thus package uri
>>>>>>> "http://*0.8.0*" where it should be "http://*3.0*").
>>>>>>>
>>>>>>> You'll need to recompile your template with Acceleo 3.0 before
>>>>>>> loading it with this version.
>>>>>>>
>>>>>>> Laurent Goubet
>>>>>>> Obeo
>>>>>>>
>>>>>>> Timothy Marc wrote:
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> i want to invoke my m2t transformation from within my wizard.
>>>>>>>> Therefore, i tried to use AcceleoService with the following
>>>>>>>> snippet:
>>>>>>>>
>>>>>>>> final URI template =
>>>>>>>> getTemplateURI("de.fraunhofer.fokus.testing.m2t.tid.ttcn3", new
>>>>>>>> Path(" /de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN3Mo dule.emtl "));
>>>>>>>>
>>>>>>>> ResourceSet mtlSet = new ResourceSetImpl();
>>>>>>>> final Resource mtlRessource =
>>>>>>>> mtlSet.getResource(template0, true);
>>>>>>>> final Module module =
>>>>>>>> (Module)mtlRessource.getContents().get(0);
>>>>>>>>
>>>>>>>> AcceleoService.doGenerate(module,"generateTTCN3Module", model,
>>>>>>>> targetFolder.getLocation().toFile(), false, null);
>>>>>>>>
>>>>>>>>
>>>>>>>> The method getTemplateURI(...) was taken from the Acceleo UI
>>>>>>>> Module Project. Unfortunately, an exception arises while trying
>>>>>>>> to load the module. The following error trace is thrown:
>>>>>>>>
>>>>>>>> java.lang.reflect.InvocationTargetException
>>>>>>>> at
>>>>>>>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
>>>>>>>> at
>>>>>>>> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:275)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.progress.ProgressManager$4.run(Progr essManager.java:966)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:1001)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:976)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.progress.ProgressManager.run(Progres sManager.java:1182)
>>>>>>>>
>>>>>>>> at
>>>>>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd.performFinish(TIDTestCaseGeneratorWizard.java:125)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:752)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:373)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
>>>>>>>> at
>>>>>>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
>>>>>>>>
>>>>>>>> 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:3880)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>>>>>>> at
>>>>>>>> org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
>>>>>>>> at org.eclipse.jface.window.Window.open(Window.java:801)
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.handlers.WizardHandler$Export.execut eHandler(WizardHandler.java:97)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
>>>>>>>>
>>>>>>>> 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:241)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.actions.CommandAction.run(CommandAct ion.java:171)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.actions.ExportResourcesAction.run(ExportResou rcesAction.java:116)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEv ent(BaseSelectionListenerAction.java:168)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
>>>>>>>>
>>>>>>>> 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:3880)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>>>>>>>> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>>>>>>>> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>>>>>>>> at
>>>>>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>>>>>>>>
>>>>>>>> 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:194)
>>>>>>>>
>>>>>>>> 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:368)
>>>>>>>>
>>>>>>>> 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: 559)
>>>>>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>>>>>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>>>>>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>>>>>>>> Caused by:
>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>>>>>>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with
>>>>>>>> uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
>>>>>>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>>>>>>> 3, 42)
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>>>>>>>
>>>>>>>> at
>>>>>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:106)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>>>>>>>
>>>>>>>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException:
>>>>>>>> Package with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not
>>>>>>>> found.
>>>>>>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>>>>>>> 3, 42)
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2590)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2421)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1299)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
>>>>>>>>
>>>>>>>> at
>>>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
>>>>>>>> Source)
>>>>>>>> at
>>>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
>>>>>>>> Source)
>>>>>>>> at
>>>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
>>>>>>>> Source)
>>>>>>>> at
>>>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
>>>>>>>> Source)
>>>>>>>> at
>>>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>>>>>>> Source)
>>>>>>>> at
>>>>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>>>>> Source)
>>>>>>>> at
>>>>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>>>>> Source)
>>>>>>>> at
>>>>>>>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>>>>>>> Source)
>>>>>>>> at
>>>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>>>>>>> Source)
>>>>>>>> at
>>>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>>>>>>> Source)
>>>>>>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doLo ad(EMtlResourceImpl.java:59)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>>>>>>>>
>>>>>>>> at
>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>>>>>>>>
>>>>>>>> ... 3 more
>>>>>>>>
>>>>>>>>
>>>>>>>> What am i doing wrong?
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>>
>>>>>>>> Timothy
>>>>>>>>
>>>>>>>
>>>>>
>>>
>>>
>
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527714 is a reply to message #527678] |
Fri, 16 April 2010 04:13   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------080600090708070103030004
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Timothy,
We recompile modules on the fly when calling the generation from the
Acceleo launch configurations... not when you call it programmatically,
sorry for the confusion.
You could use the AcceleoCompiler ant task to force a recompilation but
.... Why don't you use the default export wizard for your generation
plugin? export => deployable plugins and fragments would take care of
everything for you, emtl compilation included.
Laurent Goubet
Obeo
Timothy Marc wrote:
> Hi Laurent,
>
> but it is still interesting that, for the latest test, i used Acceleo
> 3.0, which had the same problems obviously. The stack trace i've shown
> beforehand was produced by Acceleo 3.0!
> As you said, you recompile them on thy fly, even if the generation is
> called programmatically? What i do is, i integrate the invokation of the
> generation into an export wizard!
>
> Cheers Timothy
>
> Laurent Goubet schrieb:
>> Timothy,
>>
>> That's a problem with JDT (specifically, the Java builder) removing
>> all files that are not either ".java" or ".class" from the "bin"
>> folder ... which turns out to also contain our ".emtl" compiled files.
>>
>> This is fixed with Acceleo 3.0 as we now recompile emtl files
>> on-the-fly when they're nowhere to be found and the generation is run
>> from within Eclipse (which is your case). Acceleo 0.8 didn't sport
>> this feature and you then cannot accomplish what you're trying with
>> the version.
>>
>> Be it Acceleo 0.8.1 or Acceleo 3.0, none can recompile things on the
>> fly when generations are run in standalone ; in which case you need to
>> export jars that contain the compiled ".emtl" files.
>>
>> That said, there is no reason no to switch to 3.0 instead of 0.8 as we
>> still maintain compatibility with Eclipse 3.4 and 3.5.
>>
>> Laurent Goubet
>> Obeo
>>
>> Timothy Marc wrote:
>>> Stephane,
>>>
>>> of course, Acceleo in the same version is installed in the other
>>> distribution ;-)
>>>
>>> Here is the stack trace:
>>>
>>> java.io.IOException: 'generateTTCN3Module.emtl' not found
>>> at
>>> de.fraunhofer.fokus.testing.m2t.ttcn3.files.GenerateTTCN3Mod ule. <init>(GenerateTTCN3Module.java:126)
>>>
>>> at
>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:112)
>>>
>>> at
>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>>
>>>
>>>
>>> As i mentioned in a post several month ago, as long as i invoke the
>>> transformation from within my test environment by starting a new
>>> instance of my development environment, it works perfectly. After
>>> creating an update site and installing all the tools i use in a new
>>> eclipse environment it fails. Both distributions are non-modified
>>> galileo SR2 modeling releases except of udating to Acceleo MTL 3.0.0.
>>>
>>> So, it must be somehow possible to include a Acceleo transformation
>>> into an update site, mustn't it?
>>>
>>> Thanks again
>>> Timothy
>>>
>>> St
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527721 is a reply to message #527714] |
Fri, 16 April 2010 04:46   |
Eclipse User |
|
|
|
Hi Laurent,
well, the common way to provide a plugin for somebody is via an update
site, isn't it? In addition, starting the generation from Acceleo launch
configuration is not sufficient for me. I have to include the text
generation within a wizard, obviously this is not possible at the moment.
I understand that Acceleo is open source, but you should be aware of
situation where the transformation is part of an update site build and
will be invoked by a wizard. I think, these are rather normal than
exceptional usage sceanrios. For me, the restricted capabilities of
Acceleo MTL means that i sadly can't use it in the near future.
Cheers Timothy
Laurent Goubet schrieb:
> Timothy,
>
> We recompile modules on the fly when calling the generation from the
> Acceleo launch configurations... not when you call it programmatically,
> sorry for the confusion.
>
> You could use the AcceleoCompiler ant task to force a recompilation but
> ... Why don't you use the default export wizard for your generation
> plugin? export => deployable plugins and fragments would take care of
> everything for you, emtl compilation included.
>
> Laurent Goubet
> Obeo
>
> Timothy Marc wrote:
>> Hi Laurent,
>>
>> but it is still interesting that, for the latest test, i used Acceleo
>> 3.0, which had the same problems obviously. The stack trace i've shown
>> beforehand was produced by Acceleo 3.0!
>> As you said, you recompile them on thy fly, even if the generation is
>> called programmatically? What i do is, i integrate the invokation of
>> the generation into an export wizard!
>>
>> Cheers Timothy
>>
>> Laurent Goubet schrieb:
>>> Timothy,
>>>
>>> That's a problem with JDT (specifically, the Java builder) removing
>>> all files that are not either ".java" or ".class" from the "bin"
>>> folder ... which turns out to also contain our ".emtl" compiled files.
>>>
>>> This is fixed with Acceleo 3.0 as we now recompile emtl files
>>> on-the-fly when they're nowhere to be found and the generation is run
>>> from within Eclipse (which is your case). Acceleo 0.8 didn't sport
>>> this feature and you then cannot accomplish what you're trying with
>>> the version.
>>>
>>> Be it Acceleo 0.8.1 or Acceleo 3.0, none can recompile things on the
>>> fly when generations are run in standalone ; in which case you need
>>> to export jars that contain the compiled ".emtl" files.
>>>
>>> That said, there is no reason no to switch to 3.0 instead of 0.8 as
>>> we still maintain compatibility with Eclipse 3.4 and 3.5.
>>>
>>> Laurent Goubet
>>> Obeo
>>>
>>> Timothy Marc wrote:
>>>> Stephane,
>>>>
>>>> of course, Acceleo in the same version is installed in the other
>>>> distribution ;-)
>>>>
>>>> Here is the stack trace:
>>>>
>>>> java.io.IOException: 'generateTTCN3Module.emtl' not found
>>>> at
>>>> de.fraunhofer.fokus.testing.m2t.ttcn3.files.GenerateTTCN3Mod ule. <init>(GenerateTTCN3Module.java:126)
>>>>
>>>> at
>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:112)
>>>>
>>>> at
>>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>>>
>>>>
>>>>
>>>> As i mentioned in a post several month ago, as long as i invoke the
>>>> transformation from within my test environment by starting a new
>>>> instance of my development environment, it works perfectly. After
>>>> creating an update site and installing all the tools i use in a new
>>>> eclipse environment it fails. Both distributions are non-modified
>>>> galileo SR2 modeling releases except of udating to Acceleo MTL 3.0.0.
>>>>
>>>> So, it must be somehow possible to include a Acceleo transformation
>>>> into an update site, mustn't it?
>>>>
>>>> Thanks again
>>>> Timothy
>>>>
>>>> Stéphane Bouchet schrieb:
>>>>> Hi Timothy,
>>>>>
>>>>> comments below :
>>>>>
>>>>> Timothy Marc a écrit :
>>>>>> Hi Laurent,
>>>>>>
>>>>>> i figured out, that the exception was thrown by the EEF 0.8.0
>>>>>> (Incubation) project, i had installed manually. After uninstalling
>>>>>> it, the generation works with 0.8.1.
>>>>>
>>>>>
>>>>> EEF M6 requires Acceleo 3.0.0M6, so it is the cause of your problem.
>>>>> if you want to try EEF with your actual installation use EEF M5.
>>>>>
>>>>>
>>>>>>
>>>>>> Well, one more question concerning update sites an Acceleo: I
>>>>>> bundle the generator project (0.8.1) with an update site and
>>>>>> install the whole update site in another distribution. Is this
>>>>>> what you call headless build? Because the execution of the
>>>>>> generator fails with a NUllPointerException. But how do i install
>>>>>> a generator project instead? I need an update site urgently for my
>>>>>> whole project, including the generator project.
>>>>>
>>>>> You have to install Aceeleo, too in the another distribution.
>>>>> Can you provide more stack trace for your NPE ?
>>>>>
>>>>>
>>>>>>
>>>>>> Cheers,
>>>>>> Timothy
>>>>>>
>>>>>> Laurent Goubet schrieb:
>>>>>>> Hi Timothy,
>>>>>>>
>>>>>>> Sorry, didn't think you were still using version 0.8.* :). The
>>>>>>> metamodel NsURI had been set with version "0.8.0" when we started
>>>>>>> the project, and never changed before 3.0M6 where we updated this
>>>>>>> number to "3.0". It shouldn't change more before breaking changes
>>>>>>> are made.
>>>>>>>
>>>>>>> That aside, this is not the problem you encounter. It would seem
>>>>>>> the package hasn't been registered in the EMF registry in your
>>>>>>> case ... which shouldn't be the case if you run this code in
>>>>>>> Eclipse.
>>>>>>>
>>>>>>> Anyway, what you need is this line before the resource loading :
>>>>>>> EPackage.Registry.INSTANCE.put(MtlPackage.eNS_URI,
>>>>>>> MtlPackage.eINSTANCE);
>>>>>>>
>>>>>>> Why this registration isn't taken care of by OSGi in your case, I
>>>>>>> don't really understand. Are you running this code in standalone?
>>>>>>>
>>>>>>> Laurent Goubet
>>>>>>> Obeo
>>>>>>>
>>>>>>> Timothy Marc wrote:
>>>>>>>> Hi Laurent,
>>>>>>>>
>>>>>>>> well, if i would have done this, i think i would have been able
>>>>>>>> to interprete the exception by myself, but actually, i'm
>>>>>>>> compiling and running with Acceleo 0.8.1 as part of the Galileo
>>>>>>>> Modeling Distribution SR1. Only 0.8.1 is available in my
>>>>>>>> distribution, that's why i didn't really understand why
>>>>>>>> http://www.eclipse.org/acceleo/mtl/0.8.0 was not found, since i
>>>>>>>> didn't work with 0.8.0!!
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Timothy
>>>>>>>>
>>>>>>>>
>>>>>>>> Laurent Goubet schrieb:
>>>>>>>>> Hi Timothy,
>>>>>>>>>
>>>>>>>>> You're trying to load this emtl file with Acceleo 3.0, yet it
>>>>>>>>> has been compiled with an older version (thus package uri
>>>>>>>>> "http://*0.8.0*" where it should be "http://*3.0*").
>>>>>>>>>
>>>>>>>>> You'll need to recompile your template with Acceleo 3.0 before
>>>>>>>>> loading it with this version.
>>>>>>>>>
>>>>>>>>> Laurent Goubet
>>>>>>>>> Obeo
>>>>>>>>>
>>>>>>>>> Timothy Marc wrote:
>>>>>>>>>> Hi all,
>>>>>>>>>>
>>>>>>>>>> i want to invoke my m2t transformation from within my wizard.
>>>>>>>>>> Therefore, i tried to use AcceleoService with the following
>>>>>>>>>> snippet:
>>>>>>>>>>
>>>>>>>>>> final URI template =
>>>>>>>>>> getTemplateURI("de.fraunhofer.fokus.testing.m2t.tid.ttcn3",
>>>>>>>>>> new
>>>>>>>>>> Path(" /de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN3Mo dule.emtl "));
>>>>>>>>>>
>>>>>>>>>> ResourceSet mtlSet = new
>>>>>>>>>> ResourceSetImpl();
>>>>>>>>>> final Resource mtlRessource =
>>>>>>>>>> mtlSet.getResource(template0, true);
>>>>>>>>>> final Module module =
>>>>>>>>>> (Module)mtlRessource.getContents().get(0);
>>>>>>>>>>
>>>>>>>>>> AcceleoService.doGenerate(module,"generateTTCN3Module", model,
>>>>>>>>>> targetFolder.getLocation().toFile(), false, null);
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> The method getTemplateURI(...) was taken from the Acceleo UI
>>>>>>>>>> Module Project. Unfortunately, an exception arises while
>>>>>>>>>> trying to load the module. The following error trace is thrown:
>>>>>>>>>>
>>>>>>>>>> java.lang.reflect.InvocationTargetException
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:421)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:275)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.progress.ProgressManager$4.run(Progr essManager.java:966)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:1001)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:976)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.progress.ProgressManager.run(Progres sManager.java:1182)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd.performFinish(TIDTestCaseGeneratorWizard.java:125)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDi alog.java:752)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDi alog.java:373)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.jav a:624)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
>>>>>>>>>>
>>>>>>>>>> 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:3880)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.jface.window.Window.runEventLoop(Window.java:825 )
>>>>>>>>>> at org.eclipse.jface.window.Window.open(Window.java:801)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.handlers.WizardHandler$Export.execut eHandler(WizardHandler.java:97)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.handlers.WizardHandler.execute(Wizar dHandler.java:273)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:294)
>>>>>>>>>>
>>>>>>>>>> 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:241)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.actions.CommandAction.runWithEvent(C ommandAction.java:157)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.actions.CommandAction.run(CommandAct ion.java:171)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.actions.ExportResourcesAction.run(ExportResou rcesAction.java:116)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEv ent(BaseSelectionListenerAction.java:168)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:411)
>>>>>>>>>>
>>>>>>>>>> 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:3880)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3473)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
>>>>>>>>>>
>>>>>>>>>> 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:194)
>>>>>>>>>>
>>>>>>>>>> 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:368)
>>>>>>>>>>
>>>>>>>>>> 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: 559)
>>>>>>>>>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
>>>>>>>>>> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
>>>>>>>>>> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
>>>>>>>>>> Caused by:
>>>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>>>>>>>>>> org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
>>>>>>>>>> with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0' not found.
>>>>>>>>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>>>>>>>>> 3, 42)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:106)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>>>>>>>>>
>>>>>>>>>> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException:
>>>>>>>>>> Package with uri 'http://www.eclipse.org/acceleo/mtl/0.8.0'
>>>>>>>>>> not found.
>>>>>>>>>> (platform:/plugin/de.fraunhofer.fokus.testing.m2t.tid.ttcn3/ bin/de/fraunhofer/fokus/testing/m2t/ttcn3/files/generateTTCN 3Module.emtl,
>>>>>>>>>> 3, 42)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(X MLHandler.java:2590)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefi x(XMLHandler.java:2421)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType (XMLHandler.java:1299)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XM LHandler.java:1468)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XML Handler.java:1019)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMI Handler.java:87)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:1001)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHa ndler.java:712)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHa ndler.java:169)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .startElement(Unknown
>>>>>>>>>> Source)
>>>>>>>>>> at
>>>>>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanStartElement(Unknown
>>>>>>>>>> Source)
>>>>>>>>>> at
>>>>>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl$FragmentContentDriver.next(Unknown
>>>>>>>>>> Source)
>>>>>>>>>> at
>>>>>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerIm pl.next(Unknown
>>>>>>>>>> Source)
>>>>>>>>>> at
>>>>>>>>>> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentS cannerImpl.scanDocument(Unknown
>>>>>>>>>> Source)
>>>>>>>>>> at
>>>>>>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>>>>>>> Source)
>>>>>>>>>> at
>>>>>>>>>> com.sun.org.apache.xerces.internal.parsers.XML11Configuratio n.parse(Unknown
>>>>>>>>>> Source)
>>>>>>>>>> at
>>>>>>>>>> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(U nknown
>>>>>>>>>> Source)
>>>>>>>>>> at
>>>>>>>>>> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser .parse(Unknown
>>>>>>>>>> Source)
>>>>>>>>>> at
>>>>>>>>>> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSA XParser.parse(Unknown
>>>>>>>>>> Source)
>>>>>>>>>> at javax.xml.parsers.SAXParser.parse(Unknown Source)
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl. java:181)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLRes ourceImpl.java:180)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.acceleo.model.mtl.resource.EMtlResourceImpl.doLo ad(EMtlResourceImpl.java:59)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1494)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1282)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
>>>>>>>>>>
>>>>>>>>>> at
>>>>>>>>>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
>>>>>>>>>>
>>>>>>>>>> ... 3 more
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> What am i doing wrong?
>>>>>>>>>>
>>>>>>>>>> Cheers,
>>>>>>>>>>
>>>>>>>>>> Timothy
>>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>
|
|
|
Re: [Acceleo] Problems with AcceleoService.doGenerate [message #527800 is a reply to message #527721] |
Fri, 16 April 2010 10:26  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------050704090105090304060905
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Timothy,
An Acceleo generation can be invoked from pretty much anywhere :
eclipse, rcp, standalone, headless, .... The problem here is that you
exported the Acceleo module in such a way that the compiled modules are
not part of your exported Jars.
Am I right in assuming your scenario is the following? You write Acceleo
modules (mtl files) in a given plugin. You then call for the generated
Java launcher for your module from another plugin. Both of these plugins
are exported and you create an update site to install them in another
eclipse. After installation, your action fail with the stack trace you
provided earlier.
If I am right, the problem is the way you export the two plugins
(specifically, the Acceleo plugin). I have no issue with either :
1 - right click on my acceleo project => export => deployable plugin
2 - create a feature project for my acceleo project, create an update
site project for this feature => "build"
That is, the two eclipse wizards I can think of to export
plugins/features or create update sites. How do you create your update
site (if it is indeed the update site that contains you acceleo
deployable plugin)?
Laurent Goubet
Obeo
Timothy Marc wrote:
> Hi Laurent,
>
> well, the common way to provide a plugin for somebody is via an update
> site, isn't it? In addition, starting the generation from Acceleo launch
> configuration is not sufficient for me. I have to include the text
> generation within a wizard, obviously this is not possible at the moment.
>
> I understand that Acceleo is open source, but you should be aware of
> situation where the transformation is part of an update site build and
> will be invoked by a wizard. I think, these are rather normal than
> exceptional usage sceanrios. For me, the restricted capabilities of
> Acceleo MTL means that i sadly can't use it in the near future.
>
> Cheers Timothy
>
> Laurent Goubet schrieb:
>> Timothy,
>>
>> We recompile modules on the fly when calling the generation from the
>> Acceleo launch configurations... not when you call it
>> programmatically, sorry for the confusion.
>>
>> You could use the AcceleoCompiler ant task to force a recompilation
>> but ... Why don't you use the default export wizard for your
>> generation plugin? export => deployable plugins and fragments would
>> take care of everything for you, emtl compilation included.
>>
>> Laurent Goubet
>> Obeo
>>
>> Timothy Marc wrote:
>>> Hi Laurent,
>>>
>>> but it is still interesting that, for the latest test, i used Acceleo
>>> 3.0, which had the same problems obviously. The stack trace i've
>>> shown beforehand was produced by Acceleo 3.0!
>>> As you said, you recompile them on thy fly, even if the generation is
>>> called programmatically? What i do is, i integrate the invokation of
>>> the generation into an export wizard!
>>>
>>> Cheers Timothy
>>>
>>> Laurent Goubet schrieb:
>>>> Timothy,
>>>>
>>>> That's a problem with JDT (specifically, the Java builder) removing
>>>> all files that are not either ".java" or ".class" from the "bin"
>>>> folder ... which turns out to also contain our ".emtl" compiled files.
>>>>
>>>> This is fixed with Acceleo 3.0 as we now recompile emtl files
>>>> on-the-fly when they're nowhere to be found and the generation is
>>>> run from within Eclipse (which is your case). Acceleo 0.8 didn't
>>>> sport this feature and you then cannot accomplish what you're trying
>>>> with the version.
>>>>
>>>> Be it Acceleo 0.8.1 or Acceleo 3.0, none can recompile things on the
>>>> fly when generations are run in standalone ; in which case you need
>>>> to export jars that contain the compiled ".emtl" files.
>>>>
>>>> That said, there is no reason no to switch to 3.0 instead of 0.8 as
>>>> we still maintain compatibility with Eclipse 3.4 and 3.5.
>>>>
>>>> Laurent Goubet
>>>> Obeo
>>>>
>>>> Timothy Marc wrote:
>>>>> Stephane,
>>>>>
>>>>> of course, Acceleo in the same version is installed in the other
>>>>> distribution ;-)
>>>>>
>>>>> Here is the stack trace:
>>>>>
>>>>> java.io.IOException: 'generateTTCN3Module.emtl' not found
>>>>> at
>>>>> de.fraunhofer.fokus.testing.m2t.ttcn3.files.GenerateTTCN3Mod ule. <init>(GenerateTTCN3Module.java:126)
>>>>>
>>>>> at
>>>>> de.fraunhofer.fokus.testing.m2t.tid.TIDTestCaseGeneratorWiza rd$1.run(TIDTestCaseGeneratorWizard.java:112)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
>>>>>
>>>>>
>>>>>
>>>>> As i mentioned in a post several month ago, as long as i invoke the
>>>>> transformation from within my test environment by starting a new
>>>>> instance of my development environment, it works perfectly. After
>>>>> creating an update site and installing all the tools i use in a new
>>>>> eclipse environment it fails. Both distributions are non-modified
>>>>> galileo SR2 modeling releases except of udating to Acceleo MTL 3.0.0.
>>>>>
>>>>> So, it must be somehow possible to include a Acceleo transformation
>>>>> into an update site, mustn't it?
>>>>>
>>>>> Thanks again
>>>>> Timothy
>>>>>
>>>>> St
|
|
|
Goto Forum:
Current Time: Fri Jul 18 10:55:48 EDT 2025
Powered by FUDForum. Page generated in 0.98252 seconds
|