无法获取状态更改锁

Unable to Acquire the State Change Lock

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

当然,作为 Eclipse Luna 的主要问题,当我们启动我们的应用程序时(大约 50% 的时间,我猜)有这个 "error":

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)

网络上没有太多关于问题所在的信息,大多数人建议只删除工作区,但对于大多数人来说,它只发生在启动 Eclipse 时,而不是最终的应用程序 - 尽管如此,我删除了工作区和运行时 -文件夹。没有任何帮助。 "error" 也出现在导出的产品中,但据我所知,一切仍按预期进行。

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

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

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

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

  1. 转到您的 eclipse 目录并打开配置目录。
  2. 打开org.eclipse.osgi目录。
  3. 打开 .manager 文件夹。
  4. 删除 .fileTableLock 文件。
  5. 重启你的 eclipse。

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

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

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

此文件位于 %eclipse_home%/configuration/org.eclipse.osgi 文件夹中。

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

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

步骤02: 通过以 eclipse clean 模式启动删除了 osgi 缓存和其他插件缓存

eclipse -clean

我有同样的问题,

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

2) eclipse\configuration *.log

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

对于在运行时从 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 as programm arg

解决方法很简单。只需以干净模式启动 eclipse。

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

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

  3. 输入[位置]+[space][-]清理

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

遇到了同样的问题。从“eclipse\configuration\org.eclipse.osgi.manager”中删除 .fileTableLock 并重新启动 eclipse。有效。