SWT不再处理 - 在Windows 7中

时间:2011-04-13 05:44:17

标签: java windows-7 eclipse-rcp

据客户称,我正在研究一种神秘地停止工作的旧RCP应用程序。经过多次挫折之后,我终于掌握了原始开发者的计算机(XP机器)。它在那台电脑上运行良好,很好。

所以我编译它并把它放在另一台XP机器上,运行正常。

在Windows 7计算机上运行它,它会显示启动画面,然后在关闭前显示一秒钟的主UI。

因此,我将该项目的Eclipse工作环境复制到Windows 7计算机上,它给了我相同的行为,以及错误消息:

 org.eclipse.swt.SWTError: No more handles

显然,Sleak应该是内存泄漏的答案,但它也会在整个程序死亡之前仅持续一秒钟。我认为这不是内存泄漏;启动时只打开两个视图。 Windows 7中是否存在可能限制句柄的内容?

以下是完整的错误消息:

 org.eclipse.swt.SWTError: No more handles
at org.eclipse.swt.SWT.error(SWT.java:3803)
at org.eclipse.swt.SWT.error(SWT.java:3695)
at org.eclipse.swt.SWT.error(SWT.java:3666)
at org.eclipse.swt.graphics.Image.<init>(Image.java:730)
at org.eclipse.jface.resource.FileImageDescriptor.createImage(FileImageDescriptor.java:176)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:227)
at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:205)
at org.eclipse.gef.ui.palette.editparts.PaletteEditPart$ImageCache.getImage(PaletteEditPart.java:396)
at org.eclipse.gef.ui.palette.editparts.PaletteEditPart.setImageDescriptor(PaletteEditPart.java:353)
at org.eclipse.gef.internal.ui.palette.editparts.ToolEntryEditPart.refreshVisuals(ToolEntryEditPart.java:455)
at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:676)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:571)
at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:235)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotify(AbstractGraphicalEditPart.java:219)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:198)
at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:727)
at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:677)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:571)
at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:235)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotify(AbstractGraphicalEditPart.java:219)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:198)
at org.eclipse.gef.editparts.AbstractEditPart.refreshChildren(AbstractEditPart.java:727)
at org.eclipse.gef.editparts.AbstractEditPart.refresh(AbstractEditPart.java:677)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refresh(AbstractGraphicalEditPart.java:571)
at org.eclipse.gef.editparts.AbstractEditPart.addNotify(AbstractEditPart.java:235)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.addNotify(AbstractGraphicalEditPart.java:219)
at org.eclipse.gef.editparts.AbstractEditPart.addChild(AbstractEditPart.java:198)
at org.eclipse.gef.editparts.SimpleRootEditPart.setContents(SimpleRootEditPart.java:101)
at org.eclipse.gef.ui.palette.PaletteViewer.setPaletteRoot(PaletteViewer.java:397)
at org.eclipse.gef.EditDomain.setPaletteViewer(EditDomain.java:360)
at org.eclipse.gef.ui.palette.PaletteViewerProvider.hookPaletteViewer(PaletteViewerProvider.java:76)
at org.eclipse.gef.ui.palette.PaletteViewerProvider.createPaletteViewer(PaletteViewerProvider.java:59)
at org.eclipse.gef.ui.views.palette.PaletteViewerPage.createControl(PaletteViewerPage.java:63)
at org.eclipse.gef.ui.views.palette.PaletteView.doCreatePage(PaletteView.java:100)
at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:399)
at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:741)
at org.eclipse.ui.internal.PartListenerList$1.run(PartListenerList.java:72)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:880)
at org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:57)
at org.eclipse.ui.internal.PartListenerList.firePartActivated(PartListenerList.java:70)
at org.eclipse.ui.internal.PartService.firePartActivated(PartService.java:186)
at org.eclipse.ui.internal.PartService.setActivePart(PartService.java:305)
at org.eclipse.ui.internal.WorkbenchPagePartList.fireActivePartChanged(WorkbenchPagePartList.java:56)
at org.eclipse.ui.internal.PartList.setActivePart(PartList.java:126)
at org.eclipse.ui.internal.WorkbenchPage.setActivePart(WorkbenchPage.java:3491)
at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:610)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2832)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2729)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2721)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2673)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2668)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2652)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2635)
at org.eclipse.ui.ide.IDE.openEditor(IDE.java:708)
at [companyname].gef.ApplicationWorkbenchWindowAdvisor.postWindowOpen(ApplicationWorkbenchWindowAdvisor.java:111)
at org.eclipse.ui.internal.WorkbenchWindow.fireWindowOpened(WorkbenchWindow.java:1229)
at org.eclipse.ui.internal.WorkbenchWindow.open(WorkbenchWindow.java:786)
at org.eclipse.ui.internal.Workbench$22.runWithException(Workbench.java:1043)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)
at org.eclipse.ui.internal.Workbench$27.runWithException(Workbench.java:1363)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3800)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2295)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at [companyname].gef.Application.start(Application.java:28)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
at org.eclipse.equinox.launcher.Main.main(Main.java:1212)

2 个答案:

答案 0 :(得分:1)

如果在Win XP上运行正常并且在Win 7上不起作用,那么它可能是一个SWT错误。我建议你在Eclipse bugzilla中提出一个错误。

答案 1 :(得分:1)

我已经多次这样做了,这与处理资源有关。您可能正在创建Font,Image对象,而不是通过显式调用.dispose()来释放它们。我怀疑它与Windows 7有关,它也会在那里发生,但可能需要更长的时间才会发生,因为你可能在该机器上有更多的系统资源。确保跟踪和处理分配的资源通常可以解决问题。