java.lang.NullPointerException

Spring JIRA | Tang Yong | 8 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    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

    Spring JIRA | 8 years ago | Tang Yong
    java.lang.NullPointerException
  2. 0

    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

    Spring JIRA | 8 years ago | Tang Yong
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.springframework.ide.eclipse.aop.ui.navigator.model.AbstractJavaElementReferenceNode.getResource()
    2. org.springframework.ide
      AopReferenceModelNavigatorLabelProvider.getDescription
      1. org.springframework.ide.eclipse.aop.ui.navigator.model.AbstractJavaElementReferenceNode.getResource(AbstractJavaElementReferenceNode.java:67)
      2. org.springframework.ide.eclipse.aop.ui.navigator.AopReferenceModelNavigatorLabelProvider.getDescription(AopReferenceModelNavigatorLabelProvider.java:39)
      2 frames
    3. Common Navigator View
      CommonNavigatorManager$1.selectionChanged
      1. org.eclipse.ui.internal.navigator.NavigatorContentServiceDescriptionProvider.getDescription(NavigatorContentServiceDescriptionProvider.java:72)
      2. org.eclipse.ui.internal.navigator.CommonNavigatorManager.updateStatusBar(CommonNavigatorManager.java:311)
      3. org.eclipse.ui.internal.navigator.CommonNavigatorManager$1.selectionChanged(CommonNavigatorManager.java:82)
      3 frames
    4. JFace
      StructuredViewer$3.run
      1. org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:842)
      1 frame
    5. Eclipse Core
      Platform.run
      1. org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
      2. org.eclipse.core.runtime.Platform.run(Platform.java:880)
      2 frames
    6. Eclipse UI
      JFaceUtil$1.run
      1. org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:48)
      1 frame
    7. JFace
      StructuredViewer.handlePostSelect
      1. org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
      2. org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:840)
      3. org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1153)
      3 frames
    8. Common Navigator View
      CommonViewer.handlePostSelect
      1. org.eclipse.ui.navigator.CommonViewer.handlePostSelect(CommonViewer.java:380)
      1 frame
    9. JFace
      OpenStrategy$3.run
      1. org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1178)
      2. org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:250)
      3. org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:244)
      4. org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:418)
      4 frames
    10. RWT
      Display.readAndDispatch
      1. org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
      2. org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
      3. org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3800)
      4. org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3425)
      4 frames
    11. Eclipse UI
      Workbench$5.run
      1. org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
      2. org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
      3. org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
      4. org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
      4 frames
    12. Databinding
      Realm.runWithDefault
      1. org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
      1 frame
    13. Eclipse UI
      Workbench.createAndRunWorkbench
      1. org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
      1 frame
    14. Eclipse UI
      PlatformUI.createAndRunWorkbench
      1. org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      1 frame
    15. Eclipse IDE
      IDEApplication.start
      1. org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
      1 frame
    16. Equinox Container
      EclipseAppHandle.run
      1. org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
      1 frame
    17. Eclipse OSGi
      EclipseStarter.run
      1. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
      2. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
      3. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
      4. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
      4 frames
    18. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    19. Equinox
      Main.run
      1. org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
      2. org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
      3. org.eclipse.equinox.launcher.Main.run(Main.java:1236)
      3 frames