简体   繁体   English

Eclipse Ganymede引发空指针异常

[英]Eclipse Ganymede throws null pointer exception

my eclipse IDE throws a null pointer exception from time to time on a very regular basis (every 3-4 days). 我的Eclipse IDE会不定期地(每3-4天)引发一次空指针异常。 First my Java EE project(s) will not compile and will output a nullpointer exception in the errors tab. 首先,我的Java EE项目将无法编译,并且将在错误选项卡中输出nullpointer异常。

I made sure that my project facet (java 5.0) and compiler are the same (1.5). 我确保我的项目构面(java 5.0)和编译器相同(1.5)。 However, when i restart Eclipse, the problem goes away after cleaning and rebuilding the projects - when there's no errors in the first place. 但是,当我重新启动Eclipse时,清理和重建项目后问题就消失了-首先是没有错误。

It gets annoying because it takes a long time for me to restart Eclipse IDE, clean+build, restart server and actually dev+test code. 这很烦人,因为我花了很长时间重新启动Eclipse IDE,清理+构建,重新启动服务器以及实际上是开发+测试代码。

I made sure I have plenty of memory too, 512 because I had a memory issue with Eclipse in the past as well but thats resolved. 我确保我也有足够的内存,即512,因为过去我也遇到过Eclipse的内存问题,但这已经解决了。 I mention it as it may be relevant. 我提到它可能是相关的。

I reintalled Eclipse Ganymede for Java EE 3 times in C:\\Eclipse and still have the same problem too. 我在C:\\ Eclipse中为Java EE重新安装了Eclipse Ganymede 3次,但仍然存在相同的问题。 Tried in D:\\ another partitioned disk and doesnt work. 尝试在D:\\另一个分区磁盘上不起作用。

Advice will be greatly appreciated. 意见将不胜感激。

Eclipse Platform
Version: 3.4.2
Build id: M20090211-1700
Java EE Ganymede SR2 Win32
Platform: Windows XP 32-bit

Here is the stack trace: 这是堆栈跟踪:

!ENTRY com.bea.weblogic.eclipse 4 9999 2012-06-15 12:22:53.989
!MESSAGE Unhandled Eclipse-WebLogic error
!STACK 0
java.lang.NullPointerException
at com.bea.weblogic.eclipse.model.Deployments.getName(Deployments.java:292)
at com.bea.weblogic.eclipse.model.Deployments.loadEJBs(Deployments.java:237)
at com.bea.weblogic.eclipse.model.Deployments.loadAll(Deployments.java:109)
at com.bea.weblogic.eclipse.ui.views.WebLogicServerTreeContentProvider.loadModulesAndRefresh(WebLogicServerTreeContentProvider.java:273)
at com.bea.weblogic.eclipse.ui.views.WebLogicServerTreeContentProvider.serverStateChanged(WebLogicServerTreeContentProvider.java:247)
at com.bea.weblogic.eclipse.model.ServerManager.fireServerStateChanged(ServerManager.java:94)
at com.bea.weblogic.eclipse.launcher.ServerLauncher$3.run(ServerLauncher.java:199)
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.runEventLoop(Workbench.java:2384)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
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 org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)

Some advices: 一些建议:

  • You could try to run eclipse from console, configure some logging to understand exception. 您可以尝试从控制台运行eclipse,配置一些日志以了解异常。 Maybe you should remove some plugin that you don't use. 也许您应该删除一些不使用的插件。
  • You could try to install just Eclipse Classic and after that install needed plugins. 您可以尝试仅安装Eclipse Classic,然后安装所需的插件。 I do it always and haven't got any NPE exception issues. 我总是这样做,并且没有任何NPE异常问题。 You'll get clean Eclipse without unnecessary plug-ins, so you reduce the possibility of exceptions. 您将获得干净的Eclipse,而无需不必要的插件,因此可以减少发生异常的可能性。
  • Also you could try to use new version of Eclipse - Indigo. 您也可以尝试使用新版本的Eclipse-Indigo。
  • You could also try to use some another IDE (for example: IntelliJ IDEA http://www.jetbrains.com/idea/ ) 您还可以尝试使用其他一些IDE(例如:IntelliJ IDEA http://www.jetbrains.com/idea/

It might be also interesting for you: 这可能对您也很有趣:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM