[jbosstools-issues] [JBoss JIRA] (JBIDE-19323) java.lang.NullPointerException and no results after HQL query execution when JDBC sting is incorrect

Jiri Peterka (JIRA) issues at jboss.org
Wed Jun 24 09:45:04 EDT 2015


     [ https://issues.jboss.org/browse/JBIDE-19323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jiri Peterka updated JBIDE-19323:
---------------------------------
               Summary: java.lang.NullPointerException and no results after HQL query execution when JDBC sting is incorrect  (was: java.lang.NullPointerException and no results after HQL query execution)
           Description: 
There should be some more user friendly message, not just NPE when JDBC string is not correct
{code}
!ENTRY org.eclipse.ui 4 0 2015-02-19 10:39:33.217
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1886)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
	at org.jboss.tools.hibernate.proxy.ConfigurationProxy.buildSessionFactory(ConfigurationProxy.java:117)
	at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:285)
	at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
	at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:108)
	at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:280)
	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:81)
	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:55)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:59)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:462)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1413)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3818)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3428)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:648)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:592)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.jboss.reddeer.eclipse.core.UITestApplication.start(UITestApplication.java:47)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
{code}

  was:
New for 4.3.x, works with 4.2.x.
{code}
!ENTRY org.eclipse.ui 4 0 2015-02-19 10:39:33.217
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1886)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
	at org.jboss.tools.hibernate.proxy.ConfigurationProxy.buildSessionFactory(ConfigurationProxy.java:117)
	at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:285)
	at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
	at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:108)
	at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:280)
	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:81)
	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:55)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:59)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:462)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4480)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1413)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3818)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3428)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:648)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:592)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.jboss.reddeer.eclipse.core.UITestApplication.start(UITestApplication.java:47)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
{code}

    Steps to Reproduce: 
STEP: Create maven project with Hibernate 4.3 and h2 depdencencies (or you can import the one below)
https://github.com/jbosstools/jbosstools-integration-tests/tree/master/tests/org.jboss.tools.hibernate.ui.bot.test/resources/prj/mvn-hibernate43
STEP: Convert to JPA 2.1 Hibernate Faceted project
STEP: Do some mistake in JDBC string
STEP: Generate JPA Entities from Tables (sakila db was used - https://github.com/maxandersen/sakila-h2)
STEP: Open HQL Editor 
STEP: Run from Actor query
ASSERT: Query should be executed and result should be shown in Hibernate Query Result view


  was:
STEP: Create maven project with Hibernate 4.3 and h2 depdencencies (or you can import the one below)
https://github.com/jbosstools/jbosstools-integration-tests/tree/master/tests/org.jboss.tools.hibernate.ui.bot.test/resources/prj/mvn-hibernate43
STEP: Convert to JPA 2.1 Hibernate Faceted project
STEP: Generate JPA Entities from Tables (sakila db was used - https://github.com/maxandersen/sakila-h2)
STEP: Open HQL Editor 
STEP: Run from Actor query
ASSERT: Query should be executed and result should be shown in Hibernate Query Result view




> java.lang.NullPointerException and no results after HQL query execution when JDBC sting is incorrect
> ----------------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-19323
>                 URL: https://issues.jboss.org/browse/JBIDE-19323
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: hibernate
>    Affects Versions: 4.3.0.Alpha1
>            Reporter: Jiri Peterka
>            Assignee: Jiri Peterka
>            Priority: Minor
>             Fix For: 4.3.0.Beta2
>
>
> There should be some more user friendly message, not just NPE when JDBC string is not correct
> {code}
> !ENTRY org.eclipse.ui 4 0 2015-02-19 10:39:33.217
> !MESSAGE Unhandled event loop exception
> !STACK 0
> java.lang.NullPointerException
> 	at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1886)
> 	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
> 	at org.jboss.tools.hibernate.proxy.ConfigurationProxy.buildSessionFactory(ConfigurationProxy.java:117)
> 	at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:285)
> 	at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
> 	at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:108)
> 	at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:280)
> 	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.execute(ExecuteQueryAction.java:81)
> 	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.run(ExecuteQueryAction.java:55)
> 	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
> 	at org.hibernate.eclipse.console.actions.ExecuteQueryAction.runWithEvent(ExecuteQueryAction.java:59)
> 	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
> 	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
> 	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:462)
> 	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> 	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4480)
> 	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1413)
> 	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3818)
> 	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3428)
> 	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
> 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
> 	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
> 	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
> 	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:648)
> 	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
> 	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:592)
> 	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> 	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
> 	at org.jboss.reddeer.eclipse.core.UITestApplication.start(UITestApplication.java:47)
> 	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
> 	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
> 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
> 	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:483)
> 	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
> 	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
> 	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
> 	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jbosstools-issues mailing list