Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL]Problem in run ATL standalone
[ATL]Problem in run ATL standalone [message #52667] Tue, 17 July 2007 13:13 Go to next message
stephen Yu is currently offline stephen YuFriend
Messages: 35
Registered: July 2009
Member
I'm using the latest code. I got it from CVS and exported them as plugins.
In my standalone java programme, I wrote code like:
.......
import org.eclipse.m2m.atl.engine.AtlModelHandler;
......
AtlModelHandler.getDefault("EMF");

.......
I always get following error message:
======================================
Exception in thread "main" java.lang.RuntimeException:
java.lang.NoClassDefFoundError
at
testEcore2Ecore.ModelTransform.getDefaultHandler(ModelTransf orm.java:133)
at testEcore2Ecore.ModelTransform.main(ModelTransform.java:45)
Caused by: java.lang.NoClassDefFoundError
at
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.<init>(AtlEMFModelHandler.java:117)
at
org.eclipse.m2m.atl.engine.AtlModelHandler.getDefault(AtlMod elHandler.java:55)
at
testEcore2Ecore.ModelTransform.getDefaultHandler(ModelTransf orm.java:125)
... 1 more
=========================================
By debug the code I found:
AtlModelHandler.getDefault("EMF");
--->new AtlEMFModelHandler();
--->if (Platform.isRunning()) {....}
The method call: Platform.isRunning() cause the error.
And I do not find this method call in ATL old version.
So is it a bug?
If yes, I'm going to fire a bug in bugzilla.

Thanks
Stephen Yu
Re: [ATL]Problem in run ATL standalone [message #52721 is a reply to message #52667] Tue, 17 July 2007 14:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: erik_becker.gmx.de

Hi Stephen,

I'm not sure if your solution should work, but if you change it to

AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF)

it should work.

Greetings

Erik

sfyu schrieb:
> I'm using the latest code. I got it from CVS and exported them as plugins.
> In my standalone java programme, I wrote code like:
> ......
> import org.eclipse.m2m.atl.engine.AtlModelHandler;
> .....
> AtlModelHandler.getDefault("EMF");
>
> ......
> I always get following error message:
> ======================================
> Exception in thread "main" java.lang.RuntimeException:
> java.lang.NoClassDefFoundError
> at
> testEcore2Ecore.ModelTransform.getDefaultHandler(ModelTransf orm.java:133)
> at testEcore2Ecore.ModelTransform.main(ModelTransform.java:45)
> Caused by: java.lang.NoClassDefFoundError
> at
> org.eclipse.m2m.atl.engine.AtlEMFModelHandler.<init>(AtlEMFModelHandler.java:117)
> at
> org.eclipse.m2m.atl.engine.AtlModelHandler.getDefault(AtlMod elHandler.java:55)
> at
> testEcore2Ecore.ModelTransform.getDefaultHandler(ModelTransf orm.java:125)
> ... 1 more
> =========================================
> By debug the code I found:
> AtlModelHandler.getDefault("EMF");
> --->new AtlEMFModelHandler();
> --->if (Platform.isRunning()) {....}
> The method call: Platform.isRunning() cause the error.
> And I do not find this method call in ATL old version.
> So is it a bug?
> If yes, I'm going to fire a bug in bugzilla.
>
> Thanks
> Stephen Yu
>
>
Re: [ATL]Problem in run ATL standalone [message #52888 is a reply to message #52721] Wed, 18 July 2007 00:15 Go to previous messageGo to next message
stephen Yu is currently offline stephen YuFriend
Messages: 35
Registered: July 2009
Member
Hi Erik,

In AtlModelHandler.java, you will find following declaration:
public final static String AMH_EMF = "EMF";

So what's the difference between
"AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF)
" and "AtlModelHandler.getDefault("EMF")??
"

Just as I has pointed out, the problem is caused by
"Platform.isRunning()"method call.
This method should be called within eclipse run-time workbench, right?
In my code, I run ATL in standalone mode.
Is it a regression? because my code runs well with old version of ATL.


Thanks

Stephen Yu


"Erik Becker" <erik_becker@gmx.de> wrote in message
news:f7ijoa$uuf$1@build.eclipse.org...
> Hi Stephen,
>
> I'm not sure if your solution should work, but if you change it to
>
> AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF)
>
> it should work.
>
> Greetings
>
> Erik
>
> sfyu schrieb:
>> I'm using the latest code. I got it from CVS and exported them as
>> plugins.
>> In my standalone java programme, I wrote code like:
>> ......
>> import org.eclipse.m2m.atl.engine.AtlModelHandler;
>> .....
>> AtlModelHandler.getDefault("EMF");
>>
>> ......
>> I always get following error message:
>> ======================================
>> Exception in thread "main" java.lang.RuntimeException:
>> java.lang.NoClassDefFoundError
>> at
>> testEcore2Ecore.ModelTransform.getDefaultHandler(ModelTransf orm.java:133)
>> at testEcore2Ecore.ModelTransform.main(ModelTransform.java:45)
>> Caused by: java.lang.NoClassDefFoundError
>> at
>> org.eclipse.m2m.atl.engine.AtlEMFModelHandler.<init>(AtlEMFModelHandler.java:117)
>> at
>> org.eclipse.m2m.atl.engine.AtlModelHandler.getDefault(AtlMod elHandler.java:55)
>> at
>> testEcore2Ecore.ModelTransform.getDefaultHandler(ModelTransf orm.java:125)
>> ... 1 more
>> =========================================
>> By debug the code I found:
>> AtlModelHandler.getDefault("EMF");
>> --->new AtlEMFModelHandler();
>> --->if (Platform.isRunning()) {....}
>> The method call: Platform.isRunning() cause the error.
>> And I do not find this method call in ATL old version.
>> So is it a bug?
>> If yes, I'm going to fire a bug in bugzilla.
>>
>> Thanks
>> Stephen Yu
Re: [ATL]Problem in run ATL standalone [message #52910 is a reply to message #52888] Wed, 18 July 2007 05:53 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 147
Registered: July 2009
Senior Member
Hi Stephen, Erik,

I've had this problem too, several times actually. It turns out Eclipse
classes are sometimes on the move from one jar to another ;-). The
Platform class at some point moved from the core runtime jar to an
equinox jar. Please check whether the jar files you've included in your
class path still include all classes that are needed. I use the
following Ant script to collect the jar dependencies:

http://ssel.vub.ac.be/viewcvs/viewcvs.py/UML1CaseStudies/uml 1cs-atlcommandline/lib/copydep.build.xml?rev=6870&view=m arkup

That said, I did change the AtlModelHandler code a while ago... Before,
AtlModelHandler just tried to access the Eclipse extension point
registry to find model handlers and gave up when an exception occurred.
This was changed to a check on Platform.isRunning(), since this is the
preferred method to find out whether you're running standalone or within
Eclipse. It does require the Platform class to be in your classpath,
where this previously wasn't necessary.

Regards,
Dennis

sfyu schreef:
> Hi Erik,
>
> In AtlModelHandler.java, you will find following declaration:
> public final static String AMH_EMF = "EMF";
>
> So what's the difference between
> "AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF)
> " and "AtlModelHandler.getDefault("EMF")??
> "
>
> Just as I has pointed out, the problem is caused by
> "Platform.isRunning()"method call.
> This method should be called within eclipse run-time workbench, right?
> In my code, I run ATL in standalone mode.
> Is it a regression? because my code runs well with old version of ATL.
>
>
> Thanks
>
> Stephen Yu
>
>
> "Erik Becker" <erik_becker@gmx.de> wrote in message
> news:f7ijoa$uuf$1@build.eclipse.org...
>> Hi Stephen,
>>
>> I'm not sure if your solution should work, but if you change it to
>>
>> AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF)
>>
>> it should work.
>>
>> Greetings
>>
>> Erik
>>
>> sfyu schrieb:
>>> I'm using the latest code. I got it from CVS and exported them as
>>> plugins.
>>> In my standalone java programme, I wrote code like:
>>> ......
>>> import org.eclipse.m2m.atl.engine.AtlModelHandler;
>>> .....
>>> AtlModelHandler.getDefault("EMF");
>>>
>>> ......
>>> I always get following error message:
>>> ======================================
>>> Exception in thread "main" java.lang.RuntimeException:
>>> java.lang.NoClassDefFoundError
>>> at
>>> testEcore2Ecore.ModelTransform.getDefaultHandler(ModelTransf orm.java:133)
>>> at testEcore2Ecore.ModelTransform.main(ModelTransform.java:45)
>>> Caused by: java.lang.NoClassDefFoundError
>>> at
>>> org.eclipse.m2m.atl.engine.AtlEMFModelHandler.<init>(AtlEMFModelHandler.java:117)
>>> at
>>> org.eclipse.m2m.atl.engine.AtlModelHandler.getDefault(AtlMod elHandler.java:55)
>>> at
>>> testEcore2Ecore.ModelTransform.getDefaultHandler(ModelTransf orm.java:125)
>>> ... 1 more
>>> =========================================
>>> By debug the code I found:
>>> AtlModelHandler.getDefault("EMF");
>>> --->new AtlEMFModelHandler();
>>> --->if (Platform.isRunning()) {....}
>>> The method call: Platform.isRunning() cause the error.
>>> And I do not find this method call in ATL old version.
>>> So is it a bug?
>>> If yes, I'm going to fire a bug in bugzilla.
>>>
>>> Thanks
>>> Stephen Yu
>
>
Re: [ATL]Problem in run ATL standalone [message #53700 is a reply to message #52910] Fri, 20 July 2007 03:01 Go to previous message
stephen Yu is currently offline stephen YuFriend
Messages: 35
Registered: July 2009
Member
Hi Dennis,

Thanks a lot for your help.
It seams that your ant script still miss a jar which is required.
It is org.eclipse.core.jobs.[versionnumber].jar
Without it, I still get error message when running ATL standalone.

After adding all jars mentioned in you ant scripts and the missing jar, my
programme can run and I do get the correct result after transformation,
but I still get a strange error although it does not affect the result.
see,
java.lang.IllegalStateException: Workspace is closed.
java.lang.IllegalStateException: Workspace is closed.
at
org.eclipse.core.resources.ResourcesPlugin.getWorkspace(Reso urcesPlugin.java:320)
at
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.saveModel(AtlE MFModelHandler.java:99)
at
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.saveModel(AtlE MFModelHandler.java:65)
at testEcore2Ecore.ModelTransform.main(ModelTransform.java:106)
----------------------------
It's caused by "getDefaultHandler("EMF").saveModel(currentOutModel, os);"
in my code.
What does it mean? Does anybody have idea about it?

Thanks

Stephen Yu

Dennis Wagelaar wrote:

> Hi Stephen, Erik,

> I've had this problem too, several times actually. It turns out Eclipse
> classes are sometimes on the move from one jar to another ;-). The
> Platform class at some point moved from the core runtime jar to an
> equinox jar. Please check whether the jar files you've included in your
> class path still include all classes that are needed. I use the
> following Ant script to collect the jar dependencies:

>
http://ssel.vub.ac.be/viewcvs/viewcvs.py/UML1CaseStudies/uml 1cs-atlcommandline/lib/copydep.build.xml?rev=6870&view=m arkup

> That said, I did change the AtlModelHandler code a while ago... Before,
> AtlModelHandler just tried to access the Eclipse extension point
> registry to find model handlers and gave up when an exception occurred.
> This was changed to a check on Platform.isRunning(), since this is the
> preferred method to find out whether you're running standalone or within
> Eclipse. It does require the Platform class to be in your classpath,
> where this previously wasn't necessary.

> Regards,
> Dennis

> sfyu schreef:
>> Hi Erik,
>>
>> In AtlModelHandler.java, you will find following declaration:
>> public final static String AMH_EMF = "EMF";
>>
>> So what's the difference between
>> "AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF)
>> " and "AtlModelHandler.getDefault("EMF")??
>> "
>>
>> Just as I has pointed out, the problem is caused by
>> "Platform.isRunning()"method call.
>> This method should be called within eclipse run-time workbench, right?
>> In my code, I run ATL in standalone mode.
>> Is it a regression? because my code runs well with old version of ATL.
>>
>>
>> Thanks
>>
>> Stephen Yu
>>
>>
>> "Erik Becker" <erik_becker@gmx.de> wrote in message
>> news:f7ijoa$uuf$1@build.eclipse.org...
>>> Hi Stephen,
>>>
>>> I'm not sure if your solution should work, but if you change it to
>>>
>>> AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF)
>>>
>>> it should work.
>>>
>>> Greetings
>>>
>>> Erik
>>>
>>> sfyu schrieb:
>>>> I'm using the latest code. I got it from CVS and exported them as
>>>> plugins.
>>>> In my standalone java programme, I wrote code like:
>>>> ......
>>>> import org.eclipse.m2m.atl.engine.AtlModelHandler;
>>>> .....
>>>> AtlModelHandler.getDefault("EMF");
>>>>
>>>> ......
>>>> I always get following error message:
>>>> ======================================
>>>> Exception in thread "main" java.lang.RuntimeException:
>>>> java.lang.NoClassDefFoundError
>>>> at
>>>> testEcore2Ecore.ModelTransform.getDefaultHandler(ModelTransf orm.java:133)
>>>> at testEcore2Ecore.ModelTransform.main(ModelTransform.java:45)
>>>> Caused by: java.lang.NoClassDefFoundError
>>>> at
>>>>
org.eclipse.m2m.atl.engine.AtlEMFModelHandler.<init>(AtlEMFModelHandler.java:117)
>>>> at
>>>>
org.eclipse.m2m.atl.engine.AtlModelHandler.getDefault(AtlMod elHandler.java:55)
>>>> at
>>>> testEcore2Ecore.ModelTransform.getDefaultHandler(ModelTransf orm.java:125)
>>>> ... 1 more
>>>> =========================================
>>>> By debug the code I found:
>>>> AtlModelHandler.getDefault("EMF");
>>>> --->new AtlEMFModelHandler();
>>>> --->if (Platform.isRunning()) {....}
>>>> The method call: Platform.isRunning() cause the error.
>>>> And I do not find this method call in ATL old version.
>>>> So is it a bug?
>>>> If yes, I'm going to fire a bug in bugzilla.
>>>>
>>>> Thanks
>>>> Stephen Yu
>>
>>
Previous Topic:[atl]: list of publications about ATL
Next Topic:Using collection in an imperative block section
Goto Forum:
  


Current Time: Thu Jan 21 06:31:25 GMT 2021

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

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

Back to the top