java.lang.NullPointerException

Hibernate JIRA | Joris Verschoor | 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. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 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
  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. Hibernate
      AbstractQueryImpl.setParameterList
      1. org.hibernate.impl.AbstractQueryImpl.guessType(AbstractQueryImpl.java:454)
      2. org.hibernate.impl.AbstractQueryImpl.setParameterList(AbstractQueryImpl.java:538)
      2 frames