Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » ATL stand-alone
ATL stand-alone [message #60490] Wed, 05 September 2007 07:38 Go to next message
Eclipse UserFriend
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 09:13 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 147
Registered: July 2009
Senior Member
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 #60547 is a reply to message #60490] Wed, 05 September 2007 09:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Matthias_Krebber.mra.man.de

Hi,
okay one of my questions I answered by my self.
I forgot to add:
- org.eclipse.core.jobs_3.3.0.v20070423.jar
to my classpath.

Now I have a problem to load the UML Metamodel.
I repeat my test:
input file IDs: (<model id> = <metamodel id>):
- parameters = XML
- IN = UML


transformation: --trans <transformation url> :
--trans "file:../ATLProject/queries/query.asm"


input models: --in (<id>=<model> <id>=<metamodel> [<MDR|EMF>] :
--in IN=file:"/C:/model/UMLModel.uml"
UML=uri:"http://www.eclipse.org/uml2/2.1.0/UML" EMF
--in parameters="file:/ATLProject/input/model/parameters.ecore"
XML="/ATLProject/input/metamodel/XML.ecore" EMF


Libraries: [--lib <id>=<library url>]
--lib XMLHelpers="file:/ATLProject/helpers/XMLHelpers.asm"

After passing these arguments to the application I get the following error:

Input metamodel UML @ org.eclipse.m2m.atl.engine.AtlEMFModelHandler@406199
not yet loaded - loading from uri:http://www.eclipse.org/uml2/2.1.0/UML
java.lang.IllegalArgumentException: resolve against non-hierarchical or
relative baseUsage: <this program> --trans <transformation url> [--in
<id>=<model> <id>=<metamodel> <MDR|EMF>] [--out <id>=<model>
<id>=<metamodel> <MDR|EMF>] [--lib <id>=<library url>] [--superimpose
<transformation url>] --next --trans
...java.lang.IllegalArgumentException: resolve against non-hierarchical or
relative base
at org.eclipse.emf.common.util.URI.resolve(URI.java:1940)
at org.eclipse.emf.common.util.URI.resolve(URI.java:1913)
at main.ATLStandalone.loadModel(ATLStandalone.java:109)
at main.ATLStandalone.addInputModel(ATLStandalone.java:265)
at main.ATLStandalone.parseArgs(ATLStandalone.java:193)
at main.ATLStandalone.main(ATLStandalone.java:160)

Is this the right approach to load a metamodel like the UML metamodel ?
Re: ATL stand-alone [message #60558 is a reply to message #60547] Wed, 05 September 2007 09:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mikael.barbero.gmail.com

Hi Matthias,

Did you put the UML2 plugin's jar in your classpath ? The UML2
metamodel is not available without this plugin.

Best regards,
Mikael

Matthias Krebber wrote:
> Hi,
> okay one of my questions I answered by my self.
> I forgot to add:
> - org.eclipse.core.jobs_3.3.0.v20070423.jar
> to my classpath.
>
> Now I have a problem to load the UML Metamodel.
> I repeat my test:
> input file IDs: (<model id> = <metamodel id>):
> - parameters = XML
> - IN = UML
>
>
> transformation: --trans <transformation url> :
> --trans "file:../ATLProject/queries/query.asm"
>
>
> input models: --in (<id>=<model> <id>=<metamodel> [<MDR|EMF>] :
> --in IN=file:"/C:/model/UMLModel.uml"
> UML=uri:"http://www.eclipse.org/uml2/2.1.0/UML" EMF --in
> parameters="file:/ATLProject/input/model/parameters.ecore"
> XML="/ATLProject/input/metamodel/XML.ecore" EMF
>
>
> Libraries: [--lib <id>=<library url>]
> --lib XMLHelpers="file:/ATLProject/helpers/XMLHelpers.asm"
>
> After passing these arguments to the application I get the following error:
>
> Input metamodel UML @
> org.eclipse.m2m.atl.engine.AtlEMFModelHandler@406199 not yet loaded -
> loading from uri:http://www.eclipse.org/uml2/2.1.0/UML
> java.lang.IllegalArgumentException: resolve against non-hierarchical or
> relative baseUsage: <this program> --trans <transformation url> [--in
> <id>=<model> <id>=<metamodel> <MDR|EMF>] [--out <id>=<model>
> <id>=<metamodel> <MDR|EMF>] [--lib <id>=<library url>] [--superimpose
> <transformation url>] --next --trans
> ..java.lang.IllegalArgumentException: resolve against non-hierarchical
> or relative base
> at org.eclipse.emf.common.util.URI.resolve(URI.java:1940)
> at org.eclipse.emf.common.util.URI.resolve(URI.java:1913)
> at main.ATLStandalone.loadModel(ATLStandalone.java:109)
> at main.ATLStandalone.addInputModel(ATLStandalone.java:265)
> at main.ATLStandalone.parseArgs(ATLStandalone.java:193)
> at main.ATLStandalone.main(ATLStandalone.java:160)
>
> Is this the right approach to load a metamodel like the UML metamodel ?
>



--
Mikaël Barbero - PhD Candidate
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssinière
44322 Nantes Cedex 3 - France
tel. +33 2 51 12 58 08 /\ cell.+33 6 07 63 19 00
email: Mikael.Barbero@{gmail.com, univ-nantes.fr}
http://www.sciences.univ-nantes.fr/lina/atl/
Re: ATL stand-alone [message #60567 is a reply to message #60558] Wed, 05 September 2007 10:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Matthias_Krebber.mra.man.de

Hi,
thank you for the reply.

I have put now the following uml2 archives into my classpath:
- org.eclipse.uml2_2.1.0.v200706251652.jar
- org.eclipse.uml2.uml_2.1.1.v200707311200.jar
- org.eclipse.uml2.uml.resources_2.1.0.v200706251652.jar
- org.eclipse.uml2.uml.ecore.importer_2.1.0.v200706251652.jar
- org.eclipse.uml2.common_1.3.1.v200707311200.jar
- org.eclipse.uml2.diagram.codegen_0.7.0.v200707030850.jar

But still I get the error message:
java.lang.IllegalArgumentException: resolve against non-hierarchical or
relative basejava.lang.IllegalArgumentException: resolve against
non-hierarchical or relative base
at org.eclipse.emf.common.util.URI.resolve(URI.java:1940)
at org.eclipse.emf.common.util.URI.resolve(URI.java:1913)
at main.ATLStandalone.loadModel(ATLStandalone.java:109)
at main.ATLStandalone.addInputModel(ATLStandalone.java:265)
at main.ATLStandalone.parseArgs(ATLStandalone.java:193)
at main.ATLStandalone.main(ATLStandalone.java:160)

Propably the problem have to do with
"uri:http://www.eclipse.org/uml2/2.1.0/UML".
Re: ATL stand-alone [message #60929 is a reply to message #60567] Wed, 05 September 2007 11:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Matthias_Krebber.mra.man.de

Hi,
after reading the description of William Piers I also change this line
URI absURI = URI.createURI(uri);//.resolve(cwd);

I have changed my arguments:
--trans "file:../ATLProject/queries/query.asm"
--in IN="file:C:/Dokumente und Einstellungen/arkteb/Eigene
Dateien/Diplomarbeit/Modellierung/MagicDraw/Projekt
UMLTest/Export/UMLTest.uml"
UML="http://www.eclipse.org/uml2/2.1.0/UML" EMF
--in parameters="file:../ATLProject/input/model/parameters.ecore "
XML="file:../ATLProject/input/metamodel/XML.ecore" EMF
--lib XMLHelpers="../ATLProject/helpers/XMLHelpers.asm"

I also have make some package and file extension registrations and now it
works. (like descripted in mdt uml2 migration :
http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html)

But now I tried to call a transformation that get several input files and
creates an output file. After passing the required arguments to the
stand-alone application I get the following exception:

java.lang.RuntimeException: java.lang.RuntimeException: Eclipse platform
extension registry not found. Dynamic repository lookup does not work
outside Eclipse.java.lang.RuntimeException: java.lang.RuntimeException:
Eclipse platform extension registry not found. Dynamic repository lookup
does not work outside Eclipse.
at main.ATLStandalone.getDefaultHandler(ATLStandalone.java:342)
at main.ATLStandalone.addOutputModel(ATLStandalone.java:567)
at main.ATLStandalone.parseArgs(ATLStandalone.java:457)
at main.ATLStandalone.main(ATLStandalone.java:420)
Caused by: java.lang.RuntimeException: Eclipse platform extension registry
not found. Dynamic repository lookup does not work outside Eclipse.
at
org.eclipse.m2m.atl.engine.AtlModelHandler.getDefault(AtlMod elHandler.java:60)
at main.ATLStandalone.getDefaultHandler(ATLStandalone.java:336)
... 3 more
Re: ATL stand-alone [message #60953 is a reply to message #60929] Wed, 05 September 2007 11:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Matthias_Krebber.mra.man.de

Okay,
sorry my fault. I forgot to pass the information about the output model
handler to my arguments.
Re: ATL stand-alone [message #60976 is a reply to message #60953] Wed, 05 September 2007 12:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Matthias_Krebber.mra.man.de

Hi,
while trying to call a transformation that creates one output model and
gets several input models I get the following exception:

SCHWERWIEGEND: protocol doesn't support output
java.net.UnknownServiceException: protocol doesn't support output
at java.net.URLConnection.getOutputStream(Unknown Source)
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createU RLOutputStream(URIConverterImpl.java:487)
at
org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createO utputStream(URIConverterImpl.java:380)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:961)
at
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.saveModel(AtlE MFModelHandler.java:142)
at
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.saveModel(AtlE MFModelHandler.java:61)
at main.ATLStandalone.run(ATLStandalone.java:628)
at main.ATLStandalone.main(ATLStandalone.java:422)
Output file + MM file is *.ecore
Model Handler EMF
Re: ATL stand-alone [message #61003 is a reply to message #60976] Wed, 05 September 2007 13:22 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi Matthias,

Could you try to specify your target model without the "file:/" prefix?

Although it works with source models, there may be a problem with target
models.


Regards,

Frédéric Jouault


Matthias Krebber wrote:
> Hi,
> while trying to call a transformation that creates one output model and
> gets several input models I get the following exception:
>
> SCHWERWIEGEND: protocol doesn't support output
> java.net.UnknownServiceException: protocol doesn't support output
> at java.net.URLConnection.getOutputStream(Unknown Source)
> at
> org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createU RLOutputStream(URIConverterImpl.java:487)
>
> at
> org.eclipse.emf.ecore.resource.impl.URIConverterImpl.createO utputStream(URIConverterImpl.java:380)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(Resour ceImpl.java:961)
>
> at
> org.eclipse.m2m.atl.engine.AtlEMFModelHandler.saveModel(AtlE MFModelHandler.java:142)
>
> at
> org.eclipse.m2m.atl.engine.AtlEMFModelHandler.saveModel(AtlE MFModelHandler.java:61)
>
> at main.ATLStandalone.run(ATLStandalone.java:628)
> at main.ATLStandalone.main(ATLStandalone.java:422)
> Output file + MM file is *.ecore
> Model Handler EMF
>
>
Re: ATL stand-alone [message #61074 is a reply to message #61003] Wed, 05 September 2007 15:55 Go to previous messageGo to next message
Matthias Krebber is currently offline Matthias KrebberFriend
Messages: 21
Registered: July 2009
Junior Member
Hi,
thank you for the reply.

If I specify my target model without the prefix file: then the I get the
following exception:
java.lang.IllegalStateException: Workspace is
closed.java.lang.IllegalStateException: Workspace is closed.
at
org.eclipse.core.resources.ResourcesPlugin.getWorkspace(Reso urcesPlugin.java:326)
at
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.saveModel(AtlE MFModelHandler.java:144)
at
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.saveModel(AtlE MFModelHandler.java:61)
at main.ATLStandalone.run(ATLStandalone.java:625)
at main.ATLStandalone.main(ATLStandalone.java:419)

The target model will not be saved
Re: ATL stand-alone [message #61098 is a reply to message #61074] Thu, 06 September 2007 12:57 Go to previous message
Eclipse UserFriend
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.
Previous Topic:avoiding : trying to register several rules...
Next Topic:[ATL] UML2WSDL.
Goto Forum:
  


Current Time: Sun Apr 11 23:14:17 GMT 2021

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

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

Back to the top