开发者

Workspace is closed error

开发者 https://www.devze.com 2023-01-05 22:29 出处:网络
I have created a EMF model and generated a model code for that. I have created one plugin project and i have created one class named as \'CommandTest\' which is having \"public static void main()\" me

I have created a EMF model and generated a model code for that. I have created one plugin project and i have created one class named as 'CommandTest' which is having "public static void main()" method which reads mymodel resource file.

Its working fine in eclipse 3.5.2. There is no issues am able to read the contents.

But same thing am running through command prompt, am getting error "Workspace is closed". I have included my plugin folder in my classpath.

I have used one statement resource.load(null). In this line am getting "IllegalStateException: Workspace is closed".

I want to run my project in commandline not in eclipse environment. I have searched this problem in internet, i can able to find some solutions but its all related to eclipse environment.

If anything am doing wrong in this following statement

====Code Snippet======

file = "C:\temp\mytemp.xml";

// C开发者_JAVA百科reating resource
XMLResource resource = (XMLResource) new MyModelResourceFactoryImpl().createResource(
URI.createURI(file.toURI().toString(), true));

resource.load(null);

=======================

Is it possible to run plugin project in commandline? if it is possible could any one guide me how to achieve this to avoid "workspace is closed" error?


Did you try to specify a workspace with the -data <workspace-path> command line switch? You could try as well to call Plugin.getStateLocation().

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号