Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-19323

java.lang.NullPointerException and no results after HQL query execution when JDBC sting is incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • 4.30.x
    • 4.3.0.Alpha1
    • hibernate
    • None
    • devex #124 December 2017
    • 8
    • Hide

      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

      Show
      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
    • -

      There should be some more user friendly message, not just NPE when JDBC string is not correct

      !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)
      

            kaers@redhat.com Koen Aers
            jpeterka_jira Jiri Peterka (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: