Eclipse 不会因我的插件而退出

发布于 2024-07-14 19:44:32 字数 4279 浏览 12 评论 0原文

我正在开发自己的 Eclipse 插件,遇到了一个非常奇怪的行为。 在某些非常特殊的情况下,当我关闭工作台时,Eclipse 不会退出。 它会一直挂着,直到我终止该进程。 通过 PDE 运行以及作为常规安装运行时会发生这种情况。

确实很难提供更多细节,而且我知道这是一个非常普遍的问题。 然而,我想知道是否有人遇到过这种行为并可以分享解决方案。

谢谢。 兹维基

PS. 我在工作台退出后附加所有正在运行的线程的堆栈跟踪。 也许会弹出一些东西。 此跟踪是通过在调试模式下运行 IDE、在冻结后挂起它并复制所有线程树来实现的。

Test1 [Eclipse Application] 
org.eclipse.equinox.launcher.Main at localhost:54840 (Suspended)    
    Daemon System Thread [Finalizer] (Suspended)    
        Object.wait(long) line: not available [native method]   
        ReferenceQueue<T>.remove(long) line: 120    
        ReferenceQueue<T>.remove() line: 136    
        Finalizer$FinalizerThread.run() line: 159   
    Daemon System Thread [Reference Handler] (Suspended)    
        Object.wait(long) line: not available [native method]   
        Reference$Lock(Object).wait() line: 474 
        Reference$ReferenceHandler.run() line: 116  
    Thread [main] (Suspended)   
    Daemon System Thread [Signal Dispatcher] (Suspended)    
    Daemon Thread [Thread-0] (Suspended)    
        OS.CFRunLoopRunInMode(int, double, boolean) line: not available [native method] 
        Display.sleep() line: 3902  
        IDEWorkbenchAdvisor(WorkbenchAdvisor).eventLoopIdle(Display) line: 364  
        Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2383    
        Workbench.runUI() line: 2346    
        Workbench.access$4(Workbench) line: 2198    
        Workbench$5.run() line: 493 
        Realm.runWithDefault(Realm, Runnable) line: 288 
        Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 488    
        PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149   
        IDEApplication.start(IApplicationContext) line: 113 
        EclipseAppHandle.run(Object) line: 193  
        EclipseAppLauncher.runApplication(Object) line: 110 
        EclipseAppLauncher.start(Object) line: 79   
        EclipseStarter.run(Object) line: 386    
        EclipseStarter.run(String[], Runnable) line: 179    
        NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]  
        NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39  
        DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25  
        Method.invoke(Object, Object...) line: 585  
        Main.invokeFramework(String[], URL[]) line: 549 
        Main.basicRun(String[]) line: 504   
        Main.run(String[]) line: 1236   
        Main.main(String[]) line: 1212  
    Daemon Thread [State Data Manager] (Suspended)  
        Thread.sleep(long) line: not available [native method]  
        StateManager.run() line: 297    
        Thread.run() line: 613  
    Daemon Thread [Framework Event Dispatcher] (Suspended)  
        Object.wait(long) line: not available [native method]   
        EventManager$EventThread(Object).wait() line: 474   
        EventManager$EventThread.getNextEvent() line: 377   
        EventManager$EventThread.run() line: 317    
    Daemon Thread [Start Level Event Dispatcher] (Suspended)    
        Object.wait(long) line: not available [native method]   
        EventManager$EventThread(Object).wait() line: 474   
        EventManager$EventThread.getNextEvent() line: 377   
        EventManager$EventThread.run() line: 317    
    Thread [Worker-0] (Suspended)   
        Object.wait(long) line: not available [native method]   
        WorkerPool.sleep(long) line: 185    
        WorkerPool.startJob(Worker) line: 217   
        Worker.run() line: 51   
    Daemon Thread [Java indexing] (Suspended)   
        Object.wait(long) line: not available [native method]   
        IndexManager(Object).wait() line: 474   
        IndexManager(JobManager).run() line: 371    
        Thread.run() line: 613  
    Thread [Worker-1] (Suspended)   
        Object.wait(long) line: not available [native method]   
        WorkerPool.sleep(long) line: 185    
        WorkerPool.startJob(Worker) line: 217   
        Worker.run() line: 51   
    Thread [Worker-2] (Suspended)   
        Object.wait(long) line: not available [native method]   
        WorkerPool.sleep(long) line: 185    
        WorkerPool.startJob(Worker) line: 217   
        Worker.run() line: 51   

I'm developing my own Eclipse plugin and came across a very strange behavior. In some very specific cases, Eclipse won't quit when I close the workbench. It just stays hanging until I kill the process. This happens when running through PDE and when running as a regular installation.

It is really hard to provide more details and I know that it is a very generic question. Yet, I was wondering if anyone encountered such behavior and could share the solution.

Thanks.
Zviki

PS. I'm attaching stack traces of all the running threads after the workbench is quit. Maybe something will pop out. This trace was achieved by running the IDE in debug mode, suspending it after it got frozen and copying all the threads tree.

Test1 [Eclipse Application] 
org.eclipse.equinox.launcher.Main at localhost:54840 (Suspended)    
    Daemon System Thread [Finalizer] (Suspended)    
        Object.wait(long) line: not available [native method]   
        ReferenceQueue<T>.remove(long) line: 120    
        ReferenceQueue<T>.remove() line: 136    
        Finalizer$FinalizerThread.run() line: 159   
    Daemon System Thread [Reference Handler] (Suspended)    
        Object.wait(long) line: not available [native method]   
        Reference$Lock(Object).wait() line: 474 
        Reference$ReferenceHandler.run() line: 116  
    Thread [main] (Suspended)   
    Daemon System Thread [Signal Dispatcher] (Suspended)    
    Daemon Thread [Thread-0] (Suspended)    
        OS.CFRunLoopRunInMode(int, double, boolean) line: not available [native method] 
        Display.sleep() line: 3902  
        IDEWorkbenchAdvisor(WorkbenchAdvisor).eventLoopIdle(Display) line: 364  
        Workbench.runEventLoop(Window$IExceptionHandler, Display) line: 2383    
        Workbench.runUI() line: 2346    
        Workbench.access$4(Workbench) line: 2198    
        Workbench$5.run() line: 493 
        Realm.runWithDefault(Realm, Runnable) line: 288 
        Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 488    
        PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149   
        IDEApplication.start(IApplicationContext) line: 113 
        EclipseAppHandle.run(Object) line: 193  
        EclipseAppLauncher.runApplication(Object) line: 110 
        EclipseAppLauncher.start(Object) line: 79   
        EclipseStarter.run(Object) line: 386    
        EclipseStarter.run(String[], Runnable) line: 179    
        NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]  
        NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39  
        DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25  
        Method.invoke(Object, Object...) line: 585  
        Main.invokeFramework(String[], URL[]) line: 549 
        Main.basicRun(String[]) line: 504   
        Main.run(String[]) line: 1236   
        Main.main(String[]) line: 1212  
    Daemon Thread [State Data Manager] (Suspended)  
        Thread.sleep(long) line: not available [native method]  
        StateManager.run() line: 297    
        Thread.run() line: 613  
    Daemon Thread [Framework Event Dispatcher] (Suspended)  
        Object.wait(long) line: not available [native method]   
        EventManager$EventThread(Object).wait() line: 474   
        EventManager$EventThread.getNextEvent() line: 377   
        EventManager$EventThread.run() line: 317    
    Daemon Thread [Start Level Event Dispatcher] (Suspended)    
        Object.wait(long) line: not available [native method]   
        EventManager$EventThread(Object).wait() line: 474   
        EventManager$EventThread.getNextEvent() line: 377   
        EventManager$EventThread.run() line: 317    
    Thread [Worker-0] (Suspended)   
        Object.wait(long) line: not available [native method]   
        WorkerPool.sleep(long) line: 185    
        WorkerPool.startJob(Worker) line: 217   
        Worker.run() line: 51   
    Daemon Thread [Java indexing] (Suspended)   
        Object.wait(long) line: not available [native method]   
        IndexManager(Object).wait() line: 474   
        IndexManager(JobManager).run() line: 371    
        Thread.run() line: 613  
    Thread [Worker-1] (Suspended)   
        Object.wait(long) line: not available [native method]   
        WorkerPool.sleep(long) line: 185    
        WorkerPool.startJob(Worker) line: 217   
        Worker.run() line: 51   
    Thread [Worker-2] (Suspended)   
        Object.wait(long) line: not available [native method]   
        WorkerPool.sleep(long) line: 185    
        WorkerPool.startJob(Worker) line: 217   
        Worker.run() line: 51   

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼眸 2024-07-21 19:44:32

抱歉打扰大家了...有问题。

我的问题很简单:我的一个操作处理程序在 Dispose 方法中引发了异常。 这会导致整个工作区挂起。

Sorry to bother everybody... got the problem.

My problem was simple: one of my Action Handlers threw an exception in the Dispose method. This causes the entire workspace to hang.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文