java 无法获取状态更改锁

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28623792/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 13:55:10  来源:igfitidea点击:

Unable to Acquire the State Change Lock

javaosgieclipse-luna

提问by Steffi S.

Our products are using the latest production-ready release of SWT, 3.7.2. Now since no one back then knew what the next Java version would be called (and how would they know that 8 came after 7, that's like higher mathematics), we were forced to swap the org.eclipse.osgifrom 3.7.2 to 3.10.0, so that we can now support Java 8. While that's maybe not the best of ideas, in theory it shouldwork.

我们的产品使用 SWT 的最新生产就绪版本 3.7.2。现在因为当时没有人知道下一个 Java 版本会叫什么(他们怎么知道 8 在 7 之后,这就像高等数学),我们被迫org.eclipse.osgi从 3.7.2交换到 3.10.0,这样我们现在可以支持 Java 8。虽然这可能不是最好的想法,但理论上它应该可以工作。

Of course, being the major screw-up that Eclipse Luna is, there is this one "error" when we start our applications (about 50 percent of the time, I'd guess):

当然,作为 Eclipse Luna 的主要错误,当我们启动我们的应用程序时会出现一个“错误”(我猜大概有 50% 的时间):

org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.10.0.v20140606-1445"; singleton:="true" [id=0] STARTED [STARTED] invalid
at org.eclipse.osgi.container.Module.lockStateChange(Module.java:329)
at org.eclipse.osgi.container.SystemModule.init(SystemModule.java:44)
at org.eclipse.osgi.container.SystemModule.start(SystemModule.java:170)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:412)
at org.eclipse.equinox.internal.simpleconfigurator.ConfigApplier.startBundles(ConfigApplier.java:307)
at org.eclipse.equinox.internal.simpleconfigurator.ConfigApplier.install(ConfigApplier.java:108)
at org.eclipse.equinox.internal.simpleconfigurator.SimpleConfiguratorImpl.applyConfiguration(SimpleConfiguratorImpl.java:129)
at org.eclipse.equinox.internal.simpleconfigurator.SimpleConfiguratorImpl.applyConfiguration(SimpleConfiguratorImpl.java:143)
at org.eclipse.equinox.internal.simpleconfigurator.Activator.start(Activator.java:48)
at org.eclipse.osgi.internal.framework.BundleContextImpl.run(BundleContextImpl.java:771)
at org.eclipse.osgi.internal.framework.BundleContextImpl.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)
at org.eclipse.osgi.container.Module.doStart(Module.java:571)
at org.eclipse.osgi.container.Module.start(Module.java:439)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.SystemModule.startWorker(SystemModule.java:242)
at org.eclipse.osgi.container.Module.doStart(Module.java:571)
at org.eclipse.osgi.container.Module.start(Module.java:439)
at org.eclipse.osgi.container.SystemModule.start(SystemModule.java:172)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:393)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:412)
at org.eclipse.osgi.launch.Equinox.start(Equinox.java:115)
at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:320)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

There's not much information on the web what the problem is, most suggest to just delete the workspace, but for most it only happens when starting up Eclipse, not the final applications - nonetheless, I deleted workspaces and the runtime-folders. Nothing helps. The "error" gets thrown in the exported product as well, but as far as I can tell, everything still works as expected.

网络上没有太多信息是什么问题,大多数建议只删除工作区,但大多数情况下它只在启动 Eclipse 时发生,而不是最终应用程序 - 尽管如此,我删除了工作区和运行时文件夹。没有任何帮助。导出的产品中也会抛出“错误”,但据我所知,一切仍然按预期工作。

Is there a way to fix it? And if not, is there a way to just hide that stupid exception (disable logging for a moment, clearing the log, whatever, I'm not picky)?

有办法解决吗?如果没有,有没有办法隐藏那个愚蠢的异常(暂时禁用日志记录,清除日志,无论如何,我不挑剔)?

采纳答案by BJ Hargrave

This looks like the framework start up starts simpleconfigurator which tries to start the framework again. The framework detects this recursion and throws an exception to escape it. The problem appears to be in simpleconfigurator attempting the start the framework which is starting it.

这看起来像框架启动启动 simpleconfigurator,它试图再次启动框架。框架检测到这个递归并抛出一个异常来逃避它。问题似乎出在 simpleconfigurator 尝试启动正在启动它的框架中。

回答by Prashant Gadekar

I solved problem by following these simple steps,

我按照这些简单的步骤解决了问题,

  1. Go to your eclipse directory and open configuration directory.
  2. open org.eclipse.osgi directory.
  3. open .manager folder.
  4. Delete .fileTableLock file.
  5. Restart your eclipse.
  1. 转到您的 eclipse 目录并打开配置目录。
  2. 打开 org.eclipse.osgi 目录。
  3. 打开 .manager 文件夹。
  4. 删除 .fileTableLock 文件。
  5. 重启你的日食。

回答by user3534759

I faced same issue.Deleting the given .log file from configuration folder and restarting eclipse should resolve your problem.

我遇到了同样的问题。从配置文件夹中删除给定的 .log 文件并重新启动 eclipse 应该可以解决您的问题。

回答by ?ɑ??????

I use Red Hat Developer Studio 10.4 (Eclipse 4.6) and i tried use Eclipse Checkstyle plugin.

我使用 Red Hat Developer Studio 10.4 (Eclipse 4.6) 并尝试使用 Eclipse Checkstyle 插件。

After install i restarted my IDE and received the crash notification.

安装后,我重新启动了我的 IDE 并收到了崩溃通知。

I tried all suggestions but only when i delete a file called framework.info.34my problem was solved.

我尝试了所有建议,但只有当我删除一个名为framework.info.34我的问题的文件时才解决。

This file is in %eclipse_home%/configuration/org.eclipse.osgifolder.

该文件在%eclipse_home%/configuration/org.eclipse.osgi文件夹中。

回答by Yehiya

Issue pop-up after upgrading eclipse neon through update-site along with installation of some new plugins.

通过更新站点升级 eclipse neon 并安装一些新插件后出现弹出窗口。

Step 01: I removed .fileTable.* lock files from ${eclipse_home}/configuration/org.eclipse.osgi/.manager directory.

步骤 01:我从 ${eclipse_home}/configuration/org.eclipse.osgi/.manager 目录中删除了 .fileTable.* 锁定文件。

Step 02: Removed osgi cache and other plugins cache by starting in eclipse clean mode

步骤 02:通过在 eclipse 清洁模式下启动来删除 osgi 缓存和其他插件缓存

eclipse -clean

日食-清洁

回答by Venkata Naresh Babu

i have the same issue,

我有同样的问题,

i removed the files from respective places 1) "eclipse\configuration\org.eclipse.osgi.manager" .fileTableLock .fileTable3 .fileTable4

我从各自的地方删除了文件 1) "eclipse\configuration\org.eclipse.osgi.manager" .fileTableLock .fileTable3 .fileTable4

2) eclipse\configuration *.log

2) eclipse\configuration *.log

after that i opened the eclipse, it worked with out any restart of PC.

在那之后,我打开了 eclipse,它在没有任何重启 PC 的情况下工作。

回答by Arnault Le Prévost-Corvellec

for people that have this problem until runing eclipse in runtime from eclipse : clean folder : [yourEclipseSourceWorkspace]/.metadata/.plugins/org.eclipse.pde.core/[yourRunConfiguration]/org.eclipse.osgi/.manager [yourEclipseSourceWorkspace]/.metadata/.plugins/org.eclipse.pde.core/[yourRunConfiguration]/org.eclipse.osgi remove all files (not folder) then add to your configuration -clean as programm arg

对于在运行时从 eclipse 运行 eclipse 之前遇到此问题的人:干净的文件夹:[yourEclipseSourceWorkspace]/.metadata/.plugins/org.eclipse.pde.core/[yourRunConfiguration]/org.eclipse.osgi/.manager [yourEclipseSourceWorkspace] /.metadata/.plugins/org.eclipse.pde.core/[yourRunConfiguration]/org.eclipse.osgi 删除所有文件(不是文件夹)然后添加到您的配置 -clean 作为程序参数

回答by Ravi Reddy

The solution is simple. Just start your eclipse in clean mode.

解决方法很简单。只需在干净模式下启动您的日食。

  1. Find location of "eclipse.exe" file. (Let's assume : C:\eclipse\eclipse.exe )

  2. Go to runcommand (Windows+R)

  3. Enter [location] +[space][-]clean

    Ex: C:\eclipse\eclipse.exe -clean

  1. 找到“eclipse.exe”文件的位置。(让我们假设: C:\eclipse\eclipse.exe )

  2. 转到run命令 (Windows+R)

  3. 输入 [location] +[space][-]clean

    例如:C:\eclipse\eclipse.exe -clean

enter image description here

在此处输入图片说明