问题:eclipsephp打开某个workspace时hang住,不能打开eclipse. 能成功打开其他workspace.

解决方法:

1. 查看log.  进入该workspace文件夹->.metadata->.log

!ENTRY org.eclipse.core.resources 2 10035 2018-05-05 15:00:29.044
 10 !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.eclipse.osgi 2 0 2018-05-05 15:00:46.350
 16 !MESSAGE While loading class "org.eclipse.egit.core.Activator", thread "Thread[Worker-4,5,main]" timed out waiting (5011ms) for thread "Thread[main,6,main]" to finish starting bundle "org.eclipse.egit.core_4.4.1.20160715045    5-r [116]". To avoid deadlock, thread "Thread[Worker-4,5,main]" is proceeding but "org.eclipse.egit.core.Activator" may not be fully initialized.
 17 !STACK 0
 18 org.osgi.framework.BundleException: Unable to acquire the state change lock for the module: osgi.identity; type="osgi.bundle"; version:Version="4.4.1.201607150455-r"; osgi.identity="org.eclipse.egit.core"; singleton:="true"     [id=116] STARTED [STARTED]
 19         at org.eclipse.osgi.container.Module.lockStateChange(Module.java:337)
 20         at org.eclipse.osgi.container.Module.start(Module.java:401)
 21         at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:470)
 22         at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
 23         at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
 24         at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
 25         at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:345)
 26         at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
 27         at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:407)
 28         at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
 29         at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
 30         at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
 31         at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
 32         at org.eclipse.egit.ui.Activator$RepositoryChangeScanner.run(Activator.java:617)
 33         at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
 34 Caused by: java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
 35         at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
 36         ... 14 more
 37 Root exception:
 38 java.util.concurrent.TimeoutException: Timeout after waiting 5 seconds to acquire the lock.
 39         at org.eclipse.osgi.container.Module.lockStateChange(Module.java:334)
 40         at org.eclipse.osgi.container.Module.start(Module.java:401)
 41         at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:470)
 42         at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
 43         at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:529)
 44         at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
 45         at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:345)
 46         at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
 47         at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:407)
 48         at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372)
 49         at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364)
 50         at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
 51         at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

从日志中看应该是该workspace上次退出时有没有保存的改动;试图刷新workspace来恢复这些changes.然后在恢复时出现了死锁的问题。所以解决办法应该时解决死锁。

2. google the solution.

2.1 删除.metadata->.lock文件,重试仍然不成功。

2.2 goto eclipse application folder->/Applications/EclipsePHP.app/Contents/Eclipse/configuration/org.eclipse.osgi/.manager 删除.fileTable.3  .fileTable.4 .fileTableLock

configuration\org.eclipse.osgi\.manager\.fileTable.3
configuration\org.eclipse.osgi\.manager\.fileTable.2
configuration\org.eclipse.osgi\.manager\.fileTableLock
configuration\org.eclipse.osgi\framework.info.2  //不删好像也能工作

删除后,重新打开eclipse,问题解决。

发表评论