Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL]IllegalStateException: Workspace is closed
[ATL]IllegalStateException: Workspace is closed [message #54293] Mon, 23 July 2007 09:20 Go to next message
stephen Yu is currently offline stephen YuFriend
Messages: 35
Registered: July 2009
Member
Hi,
When I call _emfamh.saveModel(xmlModel, os); //_emfamh is an instance of
AtlEMFModelHandler.

I always get
java.lang.IllegalStateException: Workspace is closed.
at
org.eclipse.core.resources.ResourcesPlugin.getWorkspace(Reso urcesPlugin.java:329)
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
com.hp.esit.util.mt.TransformationEngine.doTransformation(Tr ansformationEngine.java:285)
at
com.hp.esit.test.mt_test.EngineTest.testTransform2opcragtArg u(EngineTest.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
.......

By looking into ATL code, I found

In class 'AtlEMFModelHandler', it has a method named protected void
saveModel(final ASMModel model, URI uri, OutputStream out) {....
Which will call IFile file =
ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(uri.path()));

The problem is my ATL program is running in standalone mode, so
ResourcesPlugin is always not loaded which causes that error.

So is it a bug for ATL or I did something wrong?

Thanks a lot

Stephen Yu
Re: [ATL]IllegalStateException: Workspace is closed [message #54641 is a reply to message #54293] Wed, 25 July 2007 13:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Hugo.Bruneliere.univ-nantes.fr

Stephen Yu a écrit :
> Hi,

Hi Stephen,

> When I call _emfamh.saveModel(xmlModel, os); //_emfamh is an instance of
> AtlEMFModelHandler.
>
> I always get java.lang.IllegalStateException: Workspace is closed.
> at
> org.eclipse.core.resources.ResourcesPlugin.getWorkspace(Reso urcesPlugin.java:329)
>
> 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
> com.hp.esit.util.mt.TransformationEngine.doTransformation(Tr ansformationEngine.java:285)
>
> at
> com.hp.esit.test.mt_test.EngineTest.testTransform2opcragtArg u(EngineTest.java:93)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> ......
>
> By looking into ATL code, I found
> In class 'AtlEMFModelHandler', it has a method named protected void
> saveModel(final ASMModel model, URI uri, OutputStream out) {....
> Which will call IFile file =
> ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(uri.path()));
>
> The problem is my ATL program is running in standalone mode, so
> ResourcesPlugin is always not loaded which causes that error.
>
> So is it a bug for ATL or I did something wrong?
>

I already encountered the same kind of problem and I have submitted a
bug concerning this issue:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=197797

I have attached a patch to the bug that may be integrated soon in the
AtlEMFModelHandler:

I added a new saveModel method allowing to save a model anywhere in the
file system (independently of Eclipse).

> Thanks a lot
>
> Stephen Yu
>
>

Best regards,

Hugo

--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
Re: [ATL]IllegalStateException: Workspace is closed [message #55509 is a reply to message #54641] Wed, 01 August 2007 08:49 Go to previous message
Eclipse UserFriend
Originally posted by: Hugo.Bruneliere.univ-nantes.fr

Hugo Bruneliere a écrit :
> Stephen Yu a écrit :
>> Hi,
>
> Hi Stephen,
>
>> When I call _emfamh.saveModel(xmlModel, os); //_emfamh is an instance
>> of AtlEMFModelHandler.
>>
>> I always get java.lang.IllegalStateException: Workspace is closed.
>> at
>> org.eclipse.core.resources.ResourcesPlugin.getWorkspace(Reso urcesPlugin.java:329)
>>
>> 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
>> com.hp.esit.util.mt.TransformationEngine.doTransformation(Tr ansformationEngine.java:285)
>>
>> at
>> com.hp.esit.test.mt_test.EngineTest.testTransform2opcragtArg u(EngineTest.java:93)
>>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> ......
>>
>> By looking into ATL code, I found
>> In class 'AtlEMFModelHandler', it has a method named protected void
>> saveModel(final ASMModel model, URI uri, OutputStream out) {....
>> Which will call IFile file =
>> ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(uri.path()));
>>
>> The problem is my ATL program is running in standalone mode, so
>> ResourcesPlugin is always not loaded which causes that error.
>>
>> So is it a bug for ATL or I did something wrong?
>>
>
> I already encountered the same kind of problem and I have submitted a
> bug concerning this issue:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=197797
>
> I have attached a patch to the bug that may be integrated soon in the
> AtlEMFModelHandler:
>
> I added a new saveModel method allowing to save a model anywhere in the
> file system (independently of Eclipse).
>
>> Thanks a lot
>>
>> Stephen Yu
>>
>>
>
> Best regards,
>
> Hugo
>

Hi Stephen,

Just to say that the patch has been integrated.

Best regards,

Hugo

--
--------------------------------------------------------
Hugo Bruneliere - R&D Engineer
ATLAS Group (INRIA & LINA) - University of Nantes
2, rue de la Houssiniere
44322 Nantes Cedex 3 - France
office +33 2 51 12 58 10 /\ cell.+33 6 07 42 45 30
EMail: Hugo.Bruneliere@univ-nantes.fr
http://www.sciences.univ-nantes.fr/lina/atl/
--------------------------------------------------------
Previous Topic:[ATL] Launch a transformation from a java application
Next Topic:[ATL] Referencing Metamodels in jar-File
Goto Forum:
  


Current Time: Thu Apr 18 10:10:53 GMT 2024

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

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

Back to the top