ATL stand-alone [message #60490] |
Wed, 05 September 2007 03:38  |
Eclipse User |
|
|
|
Originally posted by: Matthias_Krebber.mra.man.de
Hi,
like others I want to use the ATL Command line tool from Dennis Wagelaar.
After downloading the Main class I put the following jar archives into my
classpath:
- antlr.jar
- ATL-importer.jar
- ebnfextractor.jar
- ebnfinjector.jar
- jmi.jar
- jmiutils.jar
- km3.jar
- KM3-importer.jar
- mdrapi.jar
- mof.jar
- nbmdr.jar
- openide-util.jar
- org.eclipse.core.resources_3.3.0.v20070604.jar
- org.eclipse.core.runtime.compatibility_3.1.200.v20070502.jar
- org.eclipse.core.runtime_3.3.100.v20070530.jar
- org.eclipse.emf.common_2.3.0.v200707242120.jar
- org.eclipse.emf.ecore.xmi_2.3.1.v200707242120.jar
- org.eclipse.emf.ecore_2.3.1.v200707242120.jar
- org.eclipse.equinox.common_3.3.0.v20070426.jar
- org.eclipse.equinox.registry_3.3.0.v20070522.jar
- org.eclipse.m2m.atl.drivers.emf4atl_2.0.0.jar
- org.eclipse.m2m.atl.drivers.mdr4atl.jar
- org.eclipse.m2m.atl.engine.jar
- org.eclipse.m2m.atl.engine.vm_2.0.0.jar
- org.eclipse.osgi_3.3.0.v20070530.jar
- TCS-importer.jar
At a first test I try to call a Query transformation that gets the
following
input files: (<model id> = <metamodel id>):
- parameters = XML
- IN = UML
Because I want to use a XML file to give my transformation query some
parameters I use the XMLHelpers.asm library to evaluate the xml file
I gave the following arguments to the main class of the stand-alone
application:
--trans file:../ATLProject/queries/query.asm
--in IN=file:"/C:/model/UMLModel.uml"
UML=uri:"http://www.eclipse.org/uml2/2.1.0/UML" EMF
--in parameters="/ATLProject/input/model/parameters.ecore"
XML="/ATLProject/input/metamodel/XML.ecore" EMF
--lib XMLHelpers=/ATLProject/helpers/XMLHelpers.asm
Because I call a query no output model will be given as argument. Is this
the right approach passing the arguments if I have several input models
comforming to metamodels ?
But after calling the application I get the following error:
java.lang.RuntimeException: java.lang.NoClassDefFoundError:
org/eclipse/core/runtime/jobs/ISchedulingRulejava.lang.Runti meException:
java.lang.NoClassDefFoundError:
org/eclipse/core/runtime/jobs/ISchedulingRule
at main.ATLStandalone.getDefaultHandler(ATLStandalone.java:91)
at main.ATLStandalone.addInputModel(ATLStandalone.java:247)
at main.ATLStandalone.parseArgs(ATLStandalone.java:196)
at main.ATLStandalone.main(ATLStandalone.java:163)
Caused by: java.lang.NoClassDefFoundError:
org/eclipse/core/runtime/jobs/ISchedulingRule
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at
org.eclipse.m2m.atl.engine.AtlModelHandler.getDefault(AtlMod elHandler.java:55)
at main.ATLStandalone.getDefaultHandler(ATLStandalone.java:85)
... 3 more
|
|
|
Re: ATL stand-alone [message #60530 is a reply to message #60490] |
Wed, 05 September 2007 05:13   |
Eclipse User |
|
|
|
Hi Matthias,
Matthias Krebber schreef:
> Hi,
> like others I want to use the ATL Command line tool from Dennis Wagelaar.
>
> After downloading the Main class I put the following jar archives into
> my classpath:
> - antlr.jar
> - ATL-importer.jar
> - ebnfextractor.jar
> - ebnfinjector.jar
> - jmi.jar
> - jmiutils.jar
> - km3.jar
> - KM3-importer.jar
> - mdrapi.jar
> - mof.jar
> - nbmdr.jar
> - openide-util.jar
> - org.eclipse.core.resources_3.3.0.v20070604.jar
> - org.eclipse.core.runtime.compatibility_3.1.200.v20070502.jar
> - org.eclipse.core.runtime_3.3.100.v20070530.jar
> - org.eclipse.emf.common_2.3.0.v200707242120.jar
> - org.eclipse.emf.ecore.xmi_2.3.1.v200707242120.jar
> - org.eclipse.emf.ecore_2.3.1.v200707242120.jar
> - org.eclipse.equinox.common_3.3.0.v20070426.jar
> - org.eclipse.equinox.registry_3.3.0.v20070522.jar
> - org.eclipse.m2m.atl.drivers.emf4atl_2.0.0.jar
> - org.eclipse.m2m.atl.drivers.mdr4atl.jar
> - org.eclipse.m2m.atl.engine.jar
> - org.eclipse.m2m.atl.engine.vm_2.0.0.jar
> - org.eclipse.osgi_3.3.0.v20070530.jar
> - TCS-importer.jar
Ah, I haven't tested the command line interface against Eclipse 3.3
class libraries yet...
>
> At a first test I try to call a Query transformation that gets the
> following
> input files: (<model id> = <metamodel id>):
> - parameters = XML
> - IN = UML
>
> Because I want to use a XML file to give my transformation query some
> parameters I use the XMLHelpers.asm library to evaluate the xml file
>
> I gave the following arguments to the main class of the stand-alone
> application:
> --trans file:../ATLProject/queries/query.asm
> --in IN=file:"/C:/model/UMLModel.uml"
> UML=uri:"http://www.eclipse.org/uml2/2.1.0/UML" EMF --in
> parameters="/ATLProject/input/model/parameters.ecore"
> XML="/ATLProject/input/metamodel/XML.ecore" EMF
> --lib XMLHelpers=/ATLProject/helpers/XMLHelpers.asm
>
Hmm, I don't know what happens when you use quotes. I don't use any. The
command line interface prints out the parameters it sends on to the ATL
engine, so you can check.
>
> Because I call a query no output model will be given as argument. Is
> this the right approach passing the arguments if I have several input
> models comforming to metamodels ?
Yes, it is ;-).
>
> But after calling the application I get the following error:
> java.lang.RuntimeException: java.lang.NoClassDefFoundError:
> org/eclipse/core/runtime/jobs/ISchedulingRulejava.lang.Runti meException:
> java.lang.NoClassDefFoundError:
> org/eclipse/core/runtime/jobs/ISchedulingRule
> at main.ATLStandalone.getDefaultHandler(ATLStandalone.java:91)
> at main.ATLStandalone.addInputModel(ATLStandalone.java:247)
> at main.ATLStandalone.parseArgs(ATLStandalone.java:196)
> at main.ATLStandalone.main(ATLStandalone.java:163)
> Caused by: java.lang.NoClassDefFoundError:
> org/eclipse/core/runtime/jobs/ISchedulingRule
> at java.lang.ClassLoader.defineClass1(Native Method)
*snip*
Well, the ISchedulingRule interface(?) isn't found and is apparently
required. This is where you start searching where the Eclipse guys put
ISchedulingRule and add that jar to your classpath ;-).
If you'd ask the Eclipse guys why they keep moving their dependencies
around and make life hard on you, they'd probably tell you to use
Eclipse's OSGi approach to manage the dependencies for you ;-). I
suppose if you can live with running your transformations inside
Eclipse, e.g. with AM3 Ant tasks, things will be a lot easier to maintain.
Oh well, pick your poison :-).
Cheers,
Dennis
|
|
|
|
|
|
|
|
|
|
|
Re: ATL stand-alone [message #61098 is a reply to message #61074] |
Thu, 06 September 2007 08:57  |
Eclipse User |
|
|
|
Originally posted by: Matthias_Krebber.mra.man.de
Hi,
after reading that a save method for output paths outside of workspace
already existing
https://bugs.eclipse.org/bugs/show_bug.cgi?id=197797
(Hugo Bruneliere)
I changed my code and do not get an exception any more.
My change:
AtlModelHandler modelHandler
=getDefaultHandler((String)handlers.get(mmName));
if (modelHandler instanceof AtlEMFModelHandler ) {
AtlEMFModelHandler emfHandler = (AtlEMFModelHandler) modelHandler;
emfHandler.saveModel(currentOutModel, (String) paths.get
(mName),IN_WORKSPACE);
}
else {
modelHandler.saveModel(currentOutModel, (String) paths.get(mName));
}
IN_WORKSPACE is a boolean constant. I give this information to the
application via a system propery.
|
|
|
Powered by
FUDForum. Page generated in 0.46006 seconds