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.

  • I created a configuration file and console configuration succefully . I also generated Java code succefully from existing Oracle DB through JDBC. But when I tried to create a SessionFactory in Hibernate Console. I got following error: Mapping documents: Code between sessionFactory.openSession() and session.close(): java.lang.NullPointerException at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationFile(ClassLoaderHelper.java:91) at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationURL(ClassLoaderHelper.java:83) at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationsURLForResources(ClassLoaderHelper.java:117) at org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseConsoleConfigurationPreferences.java:81) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:109) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:98) at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:37) at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:46) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)
    via by torrance,
  • I created a configuration file and console configuration succefully . I also generated Java code succefully from existing Oracle DB through JDBC. But when I tried to create a SessionFactory in Hibernate Console. I got following error: Mapping documents: Code between sessionFactory.openSession() and session.close(): java.lang.NullPointerException at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationFile(ClassLoaderHelper.java:91) at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationURL(ClassLoaderHelper.java:83) at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationsURLForResources(ClassLoaderHelper.java:117) at org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseConsoleConfigurationPreferences.java:81) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:109) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:98) at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:37) at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:46) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)
    via by torrance,
  • I'm getting a null pointer exception from the Hibernate Config view, when I select the 'create session factory' popup menu item. here's the stack trace: java.lang.NullPointerException at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationFile(ClassLoaderHelper.java:91) at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationURL(ClassLoaderHelper.java:83) at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationsURLForResources(ClassLoaderHelper.java:117) at org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseConsoleConfigurationPreferences.java:81) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:109) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:98) at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:37) at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:46) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1380) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1404) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1389) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1237) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3060) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2712) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) 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:324) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948) Here's how to reproduce it: create a project and select "use project folder as root for source and class files" in the java project creation wizard. create some java files, mapping files, etc. in the hibernate config, add the project root to the classpath (which makes sense here, and is the crucial point for reproducing the bug; strictly speaking the previous two steps aren't probably not essential). save the config, and try to create a session factory from it. I've looked at this in the debugger, and here's what's going on: the NPE arises on this line of code: file = ResourcesPlugin.getWorkspace().getRoot().findMember(simplePath).getRawLocation().toFile(); specifically, the call to Project.getRawLocation returns null. I don't know why that is.
    via by Loren Rosen,
  • I'm getting a null pointer exception from the Hibernate Config view, when I select the 'create session factory' popup menu item. here's the stack trace: java.lang.NullPointerException at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationFile(ClassLoaderHelper.java:91) at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationURL(ClassLoaderHelper.java:83) at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationsURLForResources(ClassLoaderHelper.java:117) at org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseConsoleConfigurationPreferences.java:81) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:109) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:98) at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:37) at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:46) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1380) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1404) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1389) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1237) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3060) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2712) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) 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:324) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948) Here's how to reproduce it: create a project and select "use project folder as root for source and class files" in the java project creation wizard. create some java files, mapping files, etc. in the hibernate config, add the project root to the classpath (which makes sense here, and is the crucial point for reproducing the bug; strictly speaking the previous two steps aren't probably not essential). save the config, and try to create a session factory from it. I've looked at this in the debugger, and here's what's going on: the NPE arises on this line of code: file = ResourcesPlugin.getWorkspace().getRoot().findMember(simplePath).getRawLocation().toFile(); specifically, the call to Project.getRawLocation returns null. I don't know why that is.
    via by Loren Rosen,
    • java.lang.NullPointerException at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationFile(ClassLoaderHelper.java:91) at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationURL(ClassLoaderHelper.java:83) at org.hibernate.eclipse.console.utils.ClassLoaderHelper.getRawLocationsURLForResources(ClassLoaderHelper.java:117) at org.hibernate.eclipse.console.EclipseConsoleConfigurationPreferences.getCustomClassPathURLS(EclipseConsoleConfigurationPreferences.java:81) at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:109) at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:98) at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:37) at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:46) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3125) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2758) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334) at org.eclipse.core.launcher.Main.basicRun(Main.java:278) at org.eclipse.core.launcher.Main.run(Main.java:973) at org.eclipse.core.launcher.Main.main(Main.java:948)
    No Bugmate found.