Eclipse异常集


1、 Eclipse异常说An internal Error occrued,我查看日志有:
ENTRY org.eclipse.ui.workbench 4 0 2010-12-08 19:13:15.500
!MESSAGE Widget disposed too early!
!STACK 0
java.lang.RuntimeException: Widget disposed too early!
at org.eclipse.ui.internal.WorkbenchPartReference$1.widgetDisposed(WorkbenchPartReference.java:172)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:117)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1008)
at org.eclipse.swt.widgets.Widget.release(Widget.java:804)
at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:756)
at org.eclipse.swt.widgets.Widget.release(Widget.java:807)
at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:756)
at org.eclipse.swt.widgets.Widget.release(Widget.java:807)
at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:756)
at org.eclipse.swt.widgets.Widget.release(Widget.java:807)
at org.eclipse.swt.widgets.Composite.releaseChildren(Composite.java:756)
at org.eclipse.swt.widgets.Canvas.releaseChildren(Canvas.java:174)
at org.eclipse.swt.widgets.Decorations.releaseChildren(Decorations.java:772)
at org.eclipse.swt.widgets.Shell.releaseChildren(Shell.java:1262)
at org.eclipse.swt.widgets.Widget.release(Widget.java:807)
at org.eclipse.swt.widgets.Widget.dispose(Widget.java:441)
at org.eclipse.swt.widgets.Decorations.dispose(Decorations.java:447)
at org.eclipse.swt.widgets.Shell.dispose(Shell.java:709)
at org.eclipse.jface.window.Window.close(Window.java:335)
at org.eclipse.jface.window.ApplicationWindow.close(ApplicationWindow.java:307)
at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1714)
at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:724)
at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:700)
at org.eclipse.ui.internal.WorkbenchWindow$5.run(WorkbenchWindow.java:816)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:814)
at org.eclipse.jface.window.WindowManager.close(WindowManager.java:109)
at org.eclipse.ui.internal.Workbench$16.run(Workbench.java:930)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:927)
at org.eclipse.ui.internal.Workbench.access$15(Workbench.java:856)
at org.eclipse.ui.internal.Workbench$23.run(Workbench.java:1100)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.Workbench.close(Workbench.java:1098)
at org.eclipse.ui.internal.Workbench.close(Workbench.java:1070)
at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:721)
at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:700)
at org.eclipse.ui.internal.WorkbenchWindow$5.run(WorkbenchWindow.java:816)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:814)
at org.eclipse.jface.window.Window.handleShellCloseEvent(Window.java:741)
at org.eclipse.jface.window.Window$3.shellClosed(Window.java:687)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:92)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:308)
at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.java:1645)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3948)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1578)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2010)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4619)
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2406)
at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:492)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1578)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2010)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4619)
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2406)
at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:492)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4036)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1578)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2010)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4619)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2411)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3501)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
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:368)
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:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

上网搜索到如下解释:

这绝对是一个非常愚蠢的BUG。网上找到的答案竟然是因为火狐更改了xulrunner的环境设置导致Eclipse找不到xulrunner的环境而不能够加载内置窗口。而且这个问题只在linux平台上出现过,可我这可是堂堂天朝产的盗版XP。

关于网上的解决办法:

A、发现只需在eclipse.ini的-vmargs参数后加上-Dorg.eclipse.swt.browser.XULRunnerPath=(xulrunner的目录)
而且是3.3对应1.8.0,3.4对应1.9.1

B、卸载火狐和xulrunner相关的产品。
   个人采取第一种方式解决,只不过没有考虑版本号的问题,本人的Eclipse为3.5.2的而XulRunner为1.8.1的。
注意:上述问题是解决了,后来发现因此导致了一个更为头疼的问题那就是Eclipse总是报OOM异常... ... 尝试了很多方法都没解决,即使内存参数也已足够大了

2、 扩展之什么是XULRunner
“XULRunner是一个Mozilla runtime package,可以用于启动XUL+XPCOM的应用程序。它提供安装、升级、卸载这些程序的机制。XULRunner的还将提供libxul,一个允许在其他产品中嵌入Mozilla技术的解决方案。”——翻译自Mozilla开发者中心的介绍

XULRunner是一个非常好用的基MOZILLA/Firefox 内核的引擎,不过可惜的是FF3所对应的Xulrunner 1.9.0 竟然不支持 Javascript的重开窗口,也就是说Google Adsense的Javascript链接地方它是不识别的,或者说是有些BUG没法识别。 也只能暂时用1.8.0.1来代替暂时用一下了。

XUL是英文“XML User Interface Language”的首字母缩写。它是为了支持Mozilla系列的应用程序(如Mozilla Firefox和Mozilla Thunderbird)而开发的使用者界面标示语言。顾名思义,它是一种应用XML来描述使用者界面的标示语言。XUL可以读作“zool”,即类似 “cool”的发音。
  虽然XUL并不是一种公开的标准,但它重用了许多现有的标准和技术,包括CSS、JavaScript、DTD和RDF等。所以对于有网络编程和设计经验的人士来说,学习XUL比学习其他使用者界面标示语言相对简单。
  使用XUL的主要好处在于它提供了一套简易和跨平台的widget定义。这节省了编程人员在开发软件时所付出的努力。

3、 拓展之查看Eclipse的版本号:
打开eclipse
导航: help-->About Eclipse
弹出框下方会显示一排logo,点击eclipse的那个logo(鼠标悬停,提示“Eclipse.org”)即可显示你的eclipse的版本(Eclipse Platform)。
其他软件的版本号也可以采取类似地查看方式... ...

4、上面异常的起因是我在Eclipse中从cvs界面中切回Flash界面时必定会抛异常:
!ENTRY org.eclipse.ui 4 0 2010-12-08 20:23:07.015
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
at org.eclipse.ui.internal.Perspective.onDeactivate(Perspective.java:1117)
at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3599)
at org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(WorkbenchPage.java:1037)
at org.eclipse.ui.internal.WorkbenchPage.access$16(WorkbenchPage.java:1021)
at org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.java:3709)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3707)
at org.eclipse.ui.internal.PerspectiveBarContributionItem.select(PerspectiveBarContributionItem.java:124)
at org.eclipse.ui.internal.PerspectiveBarContributionItem$1.widgetSelected(PerspectiveBarContributionItem.java:93)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
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:368)
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:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
我使用的环境为Eclipse3.5.2+FlashBuilder4.1插件
   尝试了很多方法都没有解决,估计是因为Eclipse组件冲突的缘故... ...

5、当运行具体的Java程序出现OOM异常时可以才如如下的方式来解决:
配置eclipse的运行菜单,在自变量里输入这样的启动参数:
-Xms128m   -Xmx640m   -XX:MaxPermSize=256M

6、Eclipse报类A不存在的异常(自定义类),在Eclipse中搜索确定异常中所说的类A存在。这下子我就纳闷了... ... 折腾了两个小时后来跑道tomcat中的工程下一看发现确实没有异常所说的A类,原来是A类没有编译。
   修复方法:Propertiest——java Build Path——src 将异常对应的那段源码添加进来
   

你可能感兴趣的:(java,eclipse,UI,OS,Access)