工作区已关闭错误 [英] Workspace is closed error

查看:349
本文介绍了工作区已关闭错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个EMF模型并生成了一个模型代码。我创建了一个插件项目,我创建了一个名为CommandTest的类,它具有读取mymodel资源文件的public static void main()方法。

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.

它在eclipse中工作正常3.5.2。没有问题可以阅读内容。

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.

我已经使用了一个语句resource.load(null)。在这行中,我得到IllegalStateException:工作区已关闭。

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

我希望在命令行中运行我的项目,而不是在eclipse环境中。我已经在互联网上搜索过这个问题,我可以找到一些解决方案,但它与eclipse环境有关。

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";

// Creating resource
XMLResource resource = (XMLResource) new MyModelResourceFactoryImpl().createResource(
URI.createURI(file.toURI().toString(), true));

resource.load(null);

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

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

是否可以在命令行中运行plugin project?如果可能的话可以指导我如何实现这一点,以避免工作空间关闭错误?

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?

推荐答案

你尝试过使用 -data< workspace-path> 命令行开关指定工作区?您也可以尝试调用 Plugin.getStateLocation()

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

这篇关于工作区已关闭错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆