Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Problem when trying to compile programmatically an ATL file with ATL 3.0
[ATL] Problem when trying to compile programmatically an ATL file with ATL 3.0 [message #100503] Mon, 23 February 2009 10:51 Go to next message
Guillaume Hillairet is currently offline Guillaume HillairetFriend
Messages: 97
Registered: July 2009
Member
Hi all,

I'm experiencing issues when trying to compile an ATL file in .asm with
the
ATL 3.0 api. I'm trying to do this like this:

meo2atl.execute(mapping, model, ontology);
String content = meo2atl.serialize();

AtlCompiler.compile(
new ByteArrayInputStream(content.getBytes()),
fileName
);

meo2atl is a call to an high order transformation that produces an ATL
model.
I serialize this ATL file by calling the method serialize and put it in
content. But when trying to call the AtlCompiler i got the following
errors. Can someone tell me where i'm wrong?

thanks.

java.lang.RuntimeException: Eclipse platform extension registry not found.
Dynamic repository lookup does not work outside Eclipse.
at
org.eclipse.m2m.atl.engine.vm.AtlModelHandler.getDefault(Atl ModelHandler.java:69)
at org.eclipse.m2m.atl.engine.parser.AtlParser.<init>(AtlParser.java:46)
at
org.eclipse.m2m.atl.engine.parser.AtlParser.getDefault(AtlPa rser.java:56)
at
org.eclipse.m2m.atl.engine.compiler.AtlDefaultCompiler.inter nalCompile(AtlDefaultCompiler.java:124)
at
org.eclipse.m2m.atl.engine.compiler.AtlDefaultCompiler.compi leWithProblemModel(AtlDefaultCompiler.java:68)
at
org.eclipse.m2m.atl.engine.compiler.AtlCompiler.compile(AtlC ompiler.java:149)
at
l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.doCo mpile(MeoLauncherFactory.java:77)
at
l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.comp ile_object2rdf(MeoLauncherFactory.java:109)
at
l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.newL auncher(MeoLauncherFactory.java:54)
at
l3i.sido.emf4sw.mood.mapper.session.TripleStoreConfiguration .configure(TripleStoreConfiguration.java:111)
at org.example.library.app.Application.<init>(Application.java:27)
at org.example.library.app.Application.main(Application.java:33 )
java.lang.NullPointerException
at
l3i.sido.emf4sw.mood.atl.impl.Meo2Atl4Rdf2Model.execute(Meo2 Atl4Rdf2Model.java:49)
at
l3i.sido.emf4sw.mood.atl.impl.Meo2Atl4Rdf2Model.execute(Meo2 Atl4Rdf2Model.java:1)
at
l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.doCo mpile(MeoLauncherFactory.java:74)
at
l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.comp ile_rdf2object(MeoLauncherFactory.java:138)
at
l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.newL auncher(MeoLauncherFactory.java:55)
at
l3i.sido.emf4sw.mood.mapper.session.TripleStoreConfiguration .configure(TripleStoreConfiguration.java:111)
at org.example.library.app.Application.<init>(Application.java:27)
at org.example.library.app.Application.main(Application.java:33 )
Re: [ATL] Problem when trying to compile programmatically an ATL file with ATL 3.0 [message #100548 is a reply to message #100503] Mon, 23 February 2009 12:54 Go to previous message
William Piers is currently offline William PiersFriend
Messages: 301
Registered: July 2009
Senior Member
Hi Guillaume,

I guess you don't launch your application as a plugin, so the extension
registry (which usually loads model handlers) doesn't work.
In your case you must first register the AtlEMFModelHandler (which is
used by the AtlParser):

AtlModelHandler.registerDefaultHandler("EMF", new AtlEMFModelHandler());
// then compile etc...

Then the model handler will be directly available and the "getDefault"
method will bypass the extension lookup.

Best Regards,

William

Guillaume Hillairet a écrit :
> Hi all,
>
> I'm experiencing issues when trying to compile an ATL file in .asm with
> the ATL 3.0 api. I'm trying to do this like this:
>
> meo2atl.execute(mapping, model, ontology);
> String content = meo2atl.serialize();
>
> AtlCompiler.compile(
> new ByteArrayInputStream(content.getBytes()), fileName
> );
>
> meo2atl is a call to an high order transformation that produces an ATL
> model.
> I serialize this ATL file by calling the method serialize and put it in
> content. But when trying to call the AtlCompiler i got the following
> errors. Can someone tell me where i'm wrong?
>
> thanks.
>
> java.lang.RuntimeException: Eclipse platform extension registry not
> found. Dynamic repository lookup does not work outside Eclipse.
> at
> org.eclipse.m2m.atl.engine.vm.AtlModelHandler.getDefault(Atl ModelHandler.java:69)
>
> at
> org.eclipse.m2m.atl.engine.parser.AtlParser.<init>(AtlParser.java:46)
> at
> org.eclipse.m2m.atl.engine.parser.AtlParser.getDefault(AtlPa rser.java:56)
> at
> org.eclipse.m2m.atl.engine.compiler.AtlDefaultCompiler.inter nalCompile(AtlDefaultCompiler.java:124)
>
> at
> org.eclipse.m2m.atl.engine.compiler.AtlDefaultCompiler.compi leWithProblemModel(AtlDefaultCompiler.java:68)
>
> at
> org.eclipse.m2m.atl.engine.compiler.AtlCompiler.compile(AtlC ompiler.java:149)
>
> at
> l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.doCo mpile(MeoLauncherFactory.java:77)
>
> at
> l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.comp ile_object2rdf(MeoLauncherFactory.java:109)
>
> at
> l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.newL auncher(MeoLauncherFactory.java:54)
>
> at
> l3i.sido.emf4sw.mood.mapper.session.TripleStoreConfiguration .configure(TripleStoreConfiguration.java:111)
>
> at org.example.library.app.Application.<init>(Application.java:27)
> at org.example.library.app.Application.main(Application.java:33 )
> java.lang.NullPointerException
> at
> l3i.sido.emf4sw.mood.atl.impl.Meo2Atl4Rdf2Model.execute(Meo2 Atl4Rdf2Model.java:49)
>
> at
> l3i.sido.emf4sw.mood.atl.impl.Meo2Atl4Rdf2Model.execute(Meo2 Atl4Rdf2Model.java:1)
>
> at
> l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.doCo mpile(MeoLauncherFactory.java:74)
>
> at
> l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.comp ile_rdf2object(MeoLauncherFactory.java:138)
>
> at
> l3i.sido.emf4sw.mood.mapper.compiler.MeoLauncherFactory.newL auncher(MeoLauncherFactory.java:55)
>
> at
> l3i.sido.emf4sw.mood.mapper.session.TripleStoreConfiguration .configure(TripleStoreConfiguration.java:111)
>
> at org.example.library.app.Application.<init>(Application.java:27)
> at org.example.library.app.Application.main(Application.java:33 )
>
>
Previous Topic:[QVTO] Blackboxing: how to set context?
Next Topic:[ATL] Problem with UML elementImport on Emf VM
Goto Forum:
  


Current Time: Mon Sep 23 22:11:27 GMT 2024

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

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

Back to the top