java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Dev Team: I encounter a bug while using BeanCrossReference. [Bug Content] My Bean Definition XML File is as follows: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="bean1" class="com.apress.prospring2.ch03.inheritance.SimpleBean" > <property name="age" value="28"/> </bean> </beans> Among the bean definition,"class" attribute is invalid. Then, I open the BeanCrossReference Tool, link the tool with the above Bean XML File, and show the Bean References. The show result is that the node value below "class" node of "bean1" node is "<source type not found>". Then, I click the "<source type not found>" . But the NPE occured. The NPE Stack Trace is as follows: !ENTRY org.eclipse.jface 4 2 2009-02-09 15:19:07.734 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 java.lang.NullPointerException at org.springframework.ide.eclipse.aop.ui.navigator.model.AbstractJavaElementReferenceNode.getResource(AbstractJavaElementReferenceNode.java:67) at org.springframework.ide.eclipse.aop.ui.navigator.AopReferenceModelNavigatorLabelProvider.getDescription(AopReferenceModelNavigatorLabelProvider.java:39) at org.eclipse.ui.internal.navigator.NavigatorContentServiceDescriptionProvider.getDescription(NavigatorContentServiceDescriptionProvider.java:72) at org.eclipse.ui.internal.navigator.CommonNavigatorManager.updateStatusBar(CommonNavigatorManager.java:311) at org.eclipse.ui.internal.navigator.CommonNavigatorManager$1.selectionChanged(CommonNavigatorManager.java:82) at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:842) 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.JFaceUtil$1.run(JFaceUtil.java:48) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:840) at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1153) at org.eclipse.ui.navigator.CommonViewer.handlePostSelect(CommonViewer.java:380) at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1178) at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:250) at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:244) at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:418) 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:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) 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:382) 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) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) So, I think that this is a bug of Spring IDE. Wish the team can confirm it. Thanks! ---Mike Tang
    via by Tang Yong,
  • Dev Team: I encounter a bug while using BeanCrossReference. [Bug Content] My Bean Definition XML File is as follows: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="bean1" class="com.apress.prospring2.ch03.inheritance.SimpleBean" > <property name="age" value="28"/> </bean> </beans> Among the bean definition,"class" attribute is invalid. Then, I open the BeanCrossReference Tool, link the tool with the above Bean XML File, and show the Bean References. The show result is that the node value below "class" node of "bean1" node is "<source type not found>". Then, I click the "<source type not found>" . But the NPE occured. The NPE Stack Trace is as follows: !ENTRY org.eclipse.jface 4 2 2009-02-09 15:19:07.734 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 java.lang.NullPointerException at org.springframework.ide.eclipse.aop.ui.navigator.model.AbstractJavaElementReferenceNode.getResource(AbstractJavaElementReferenceNode.java:67) at org.springframework.ide.eclipse.aop.ui.navigator.AopReferenceModelNavigatorLabelProvider.getDescription(AopReferenceModelNavigatorLabelProvider.java:39) at org.eclipse.ui.internal.navigator.NavigatorContentServiceDescriptionProvider.getDescription(NavigatorContentServiceDescriptionProvider.java:72) at org.eclipse.ui.internal.navigator.CommonNavigatorManager.updateStatusBar(CommonNavigatorManager.java:311) at org.eclipse.ui.internal.navigator.CommonNavigatorManager$1.selectionChanged(CommonNavigatorManager.java:82) at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:842) 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.JFaceUtil$1.run(JFaceUtil.java:48) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:840) at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1153) at org.eclipse.ui.navigator.CommonViewer.handlePostSelect(CommonViewer.java:380) at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1178) at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:250) at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:244) at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:418) 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:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) 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:382) 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) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) So, I think that this is a bug of Spring IDE. Wish the team can confirm it. Thanks! ---Mike Tang
    via by Tang Yong,
    • java.lang.NullPointerException at org.springframework.ide.eclipse.aop.ui.navigator.model.AbstractJavaElementReferenceNode.getResource(AbstractJavaElementReferenceNode.java:67) at org.springframework.ide.eclipse.aop.ui.navigator.AopReferenceModelNavigatorLabelProvider.getDescription(AopReferenceModelNavigatorLabelProvider.java:39) at org.eclipse.ui.internal.navigator.NavigatorContentServiceDescriptionProvider.getDescription(NavigatorContentServiceDescriptionProvider.java:72) at org.eclipse.ui.internal.navigator.CommonNavigatorManager.updateStatusBar(CommonNavigatorManager.java:311) at org.eclipse.ui.internal.navigator.CommonNavigatorManager$1.selectionChanged(CommonNavigatorManager.java:82) at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:842) 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.JFaceUtil$1.run(JFaceUtil.java:48) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:840) at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1153) at org.eclipse.ui.navigator.CommonViewer.handlePostSelect(CommonViewer.java:380) at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1178) at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:250) at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:244) at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:418) 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:2382) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488) 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:382) 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) at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
    No Bugmate found.