java.lang.NullPointerException

Hibernate JIRA | Jacob L E Blain Christen | 1 decade ago
  1. 0

    I am getting a null pointer exception when attempting to view an entity in the properties view (e.g. clicking on a "Hibernate Query Result" after running some HQL through the console). This isn't a super major bug but it is annoying because I was using hibernate console to get quick feedback on tweaks I make to my mappings while developing and lost a few hours on the assumption that the error was just HB Tools's way of telling me they were bad =( This is happening on an object that has some joins to aggregate some optional data. A snippet of the mapping: <join optional="true" table="item_instruments"> <key column="item" unique="true" /> <many-to-one name="instrumentInfo" column="item" unique="true" insert="false" update="false" /> </join> <join optional="true" table="item_stackables"> <key column="item" unique="true"/> <property name="stackSize" column="stacksize" type="java.lang.Short" /> </join> If any of the properties on the mapped object defined with joins are null, the following NPE occurs and the properties window does nothing (silently ignoring the problem): java.lang.NullPointerException at org.hibernate.proxy.HibernateProxyHelper.getClassWithoutInitializingProxy(HibernateProxyHelper.java:23) at org.hibernate.eclipse.console.views.properties.HibernatePropertySourceProvider.hasMetaData(HibernatePropertySourceProvider.java:47) at org.hibernate.eclipse.console.views.properties.HibernatePropertySourceProvider.getPropertySource(HibernatePropertySourceProvider.java:36) at org.eclipse.ui.views.properties.PropertySheetEntry.getPropertySource(PropertySheetEntry.java:470) at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:759) at org.eclipse.ui.views.properties.PropertySheetEntry.refreshValues(PropertySheetEntry.java:622) at org.eclipse.ui.views.properties.PropertySheetEntry.refreshChildEntries(PropertySheetEntry.java:575) at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:767) at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:943) at org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:473) at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:218) at org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156) at org.eclipse.ui.internal.AbstractSelectionService$1.selectionChanged(AbstractSelectionService.java:62) at org.hibernate.eclipse.console.views.QueryPageTabView.fireSelectionChangedEvent(QueryPageTabView.java:151) at org.hibernate.eclipse.console.views.QueryPageViewer.tableDoubleClicked(QueryPageViewer.java:212) at org.hibernate.eclipse.console.views.QueryPageViewer.access$0(QueryPageViewer.java:207) at org.hibernate.eclipse.console.views.QueryPageViewer$3.selectionChanged(QueryPageViewer.java:201) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:843) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1976) at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1128) at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1154) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:213) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:207) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:374) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3164) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 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.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)

    Hibernate JIRA | 1 decade ago | Jacob L E Blain Christen
    java.lang.NullPointerException
  2. 0

    I am getting a null pointer exception when attempting to view an entity in the properties view (e.g. clicking on a "Hibernate Query Result" after running some HQL through the console). This isn't a super major bug but it is annoying because I was using hibernate console to get quick feedback on tweaks I make to my mappings while developing and lost a few hours on the assumption that the error was just HB Tools's way of telling me they were bad =( This is happening on an object that has some joins to aggregate some optional data. A snippet of the mapping: <join optional="true" table="item_instruments"> <key column="item" unique="true" /> <many-to-one name="instrumentInfo" column="item" unique="true" insert="false" update="false" /> </join> <join optional="true" table="item_stackables"> <key column="item" unique="true"/> <property name="stackSize" column="stacksize" type="java.lang.Short" /> </join> If any of the properties on the mapped object defined with joins are null, the following NPE occurs and the properties window does nothing (silently ignoring the problem): java.lang.NullPointerException at org.hibernate.proxy.HibernateProxyHelper.getClassWithoutInitializingProxy(HibernateProxyHelper.java:23) at org.hibernate.eclipse.console.views.properties.HibernatePropertySourceProvider.hasMetaData(HibernatePropertySourceProvider.java:47) at org.hibernate.eclipse.console.views.properties.HibernatePropertySourceProvider.getPropertySource(HibernatePropertySourceProvider.java:36) at org.eclipse.ui.views.properties.PropertySheetEntry.getPropertySource(PropertySheetEntry.java:470) at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:759) at org.eclipse.ui.views.properties.PropertySheetEntry.refreshValues(PropertySheetEntry.java:622) at org.eclipse.ui.views.properties.PropertySheetEntry.refreshChildEntries(PropertySheetEntry.java:575) at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:767) at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:943) at org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:473) at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:218) at org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156) at org.eclipse.ui.internal.AbstractSelectionService$1.selectionChanged(AbstractSelectionService.java:62) at org.hibernate.eclipse.console.views.QueryPageTabView.fireSelectionChangedEvent(QueryPageTabView.java:151) at org.hibernate.eclipse.console.views.QueryPageViewer.tableDoubleClicked(QueryPageViewer.java:212) at org.hibernate.eclipse.console.views.QueryPageViewer.access$0(QueryPageViewer.java:207) at org.hibernate.eclipse.console.views.QueryPageViewer$3.selectionChanged(QueryPageViewer.java:201) at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.core.runtime.Platform.run(Platform.java:843) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160) at org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1976) at org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1128) at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1154) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:213) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:207) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:374) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3164) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 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.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)

    Hibernate JIRA | 1 decade ago | Jacob L E Blain Christen
    java.lang.NullPointerException
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.hibernate.proxy.HibernateProxyHelper.getClassWithoutInitializingProxy()
    2. Hibernate
      HibernateProxyHelper.getClassWithoutInitializingProxy
      1. org.hibernate.proxy.HibernateProxyHelper.getClassWithoutInitializingProxy(HibernateProxyHelper.java:23)
      1 frame
    3. org.hibernate.eclipse
      HibernatePropertySourceProvider.getPropertySource
      1. org.hibernate.eclipse.console.views.properties.HibernatePropertySourceProvider.hasMetaData(HibernatePropertySourceProvider.java:47)
      2. org.hibernate.eclipse.console.views.properties.HibernatePropertySourceProvider.getPropertySource(HibernatePropertySourceProvider.java:36)
      2 frames
    4. Eclipse UI
      PropertySheet.selectionChanged
      1. org.eclipse.ui.views.properties.PropertySheetEntry.getPropertySource(PropertySheetEntry.java:470)
      2. org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:759)
      3. org.eclipse.ui.views.properties.PropertySheetEntry.refreshValues(PropertySheetEntry.java:622)
      4. org.eclipse.ui.views.properties.PropertySheetEntry.refreshChildEntries(PropertySheetEntry.java:575)
      5. org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:767)
      6. org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:943)
      7. org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:473)
      8. org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:218)
      8 frames
    5. Eclipse UI
      AbstractSelectionService$1.selectionChanged
      1. org.eclipse.ui.internal.AbstractSelectionService.fireSelection(AbstractSelectionService.java:156)
      2. org.eclipse.ui.internal.AbstractSelectionService$1.selectionChanged(AbstractSelectionService.java:62)
      2 frames
    6. org.hibernate.eclipse
      QueryPageViewer$3.selectionChanged
      1. org.hibernate.eclipse.console.views.QueryPageTabView.fireSelectionChangedEvent(QueryPageTabView.java:151)
      2. org.hibernate.eclipse.console.views.QueryPageViewer.tableDoubleClicked(QueryPageViewer.java:212)
      3. org.hibernate.eclipse.console.views.QueryPageViewer.access$0(QueryPageViewer.java:207)
      4. org.hibernate.eclipse.console.views.QueryPageViewer$3.selectionChanged(QueryPageViewer.java:201)
      4 frames
    7. JFace
      Viewer$2.run
      1. org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
      1 frame
    8. Eclipse Core
      Platform.run
      1. org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
      2. org.eclipse.core.runtime.Platform.run(Platform.java:843)
      2 frames
    9. Eclipse UI
      JFaceUtil$1.run
      1. org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
      1 frame
    10. JFace
      OpenStrategy$1.handleEvent
      1. org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:149)
      2. org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer.java:160)
      3. org.eclipse.jface.viewers.StructuredViewer.updateSelection(StructuredViewer.java:1976)
      4. org.eclipse.jface.viewers.StructuredViewer.handleSelect(StructuredViewer.java:1128)
      5. org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1154)
      6. org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:213)
      7. org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:207)
      8. org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:374)
      8 frames
    11. RWT
      Display.readAndDispatch
      1. org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
      2. org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
      3. org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3164)
      4. org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2840)
      4 frames
    12. Eclipse UI
      Workbench.createAndRunWorkbench
      1. org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
      2. org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
      3. org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
      3 frames
    13. Eclipse UI
      IDEApplication.run
      1. org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      2. org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
      2 frames
    14. Eclipse Core
      PlatformActivator$1.run
      1. org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
      1 frame
    15. Eclipse OSGi
      EclipseStarter.run
      1. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
      2. org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
      3. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
      4. org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
      4 frames
    16. 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
    17. Equinox
      Main.main
      1. org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
      2. org.eclipse.core.launcher.Main.basicRun(Main.java:280)
      3. org.eclipse.core.launcher.Main.run(Main.java:977)
      4. org.eclipse.core.launcher.Main.main(Main.java:952)
      4 frames