-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: NullPointerException executing any well-formed query
PostPosted: Mon Jan 09, 2006 5:02 pm 
Newbie

Joined: Mon Jan 09, 2006 4:44 pm
Posts: 5
[Hibernate 3.1, tools 3.1, oracle 10gR2]

I'm pretty new to the hibernate tools, and I've tried looking through the docs and google for help on this one, to no avail. Can any of the user's out there lend a hand?

I'm getting an exception whenever I try to use the Eclipse HQL worksheet (of if I just double-click a mapped object) that prevents me from testing queries.

When I double-click, I get the following stack trace (I was able to successfully reverse-engineer and examine the DB, etc.):

Code:
java.lang.NullPointerException
   at org.hibernate.impl.SessionFactoryImpl.getReturnAliases(SessionFactoryImpl.java:621)   at org.hibernate.impl.AbstractQueryImpl.getReturnAliases(AbstractQueryImpl.java:156)
   at org.hibernate.console.HQLQueryPage.getPathNames(HQLQueryPage.java:95)
   at org.hibernate.eclipse.console.views.QueryPageViewer.addColumnsToTable(QueryPageViewer.java:215)
   at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:170)
   at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:153)
   at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:111)
   at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:88)
   at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:52)
   at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:62)
   at javax.swing.AbstractListModel.fireIntervalAdded(AbstractListModel.java:130)
   at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50)
   at org.hibernate.console.KnownConfigurations$1.queryPageCreated(KnownConfigurations.java:60)
   at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:306)
   at org.hibernate.console.ConsoleConfiguration.access$5(ConsoleConfiguration.java:302)
   at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:295)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
   at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:287)
   at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:282)
   at org.hibernate.eclipse.console.views.KnownConfigurationsView$3.run(KnownConfigurationsView.java:133)
   at org.hibernate.eclipse.console.views.KnownConfigurationsView$1.doubleClick(KnownConfigurationsView.java:77)
   at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720)
   at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
   at org.eclipse.core.runtime.Platform.run(Platform.java:783)
   at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
   at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
   at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718)
   at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950)
   at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057)
   at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:219)
   at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:216)
   at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:275)
   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:3080)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
   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)

When I try to create my own query in the HQL worksheet, such as...

"from AccountProfile"

The dynamic SQL translator correctly translates this to the following query...

Code:
select
  accountpro0_.BO_ID as BO1_1296_,
  accountpro0_.BO_CLIENT_ID as BO2_1296_,
  accountpro0_.BRANCH_CD as BRANCH3_1296_,
  accountpro0_.ACCOUNT_CD as ACCOUNT4_1296_,
  accountpro0_.RR_CD as RR5_1296_,
  accountpro0_.CREATE_DT as CREATE6_1296_,
  accountpro0_.CHANGE_DT as CHANGE7_1296_,
  accountpro0_.SSN_TAX_ID_1 as SSN8_1296_,
  accountpro0_.SSN_TAX_ID_2 as SSN9_1296_,
  accountpro0_.PRIMARY_FIRST_NM as PRIMARY10_1296_,
  accountpro0_.PRIMARY_LAST_NM as PRIMARY11_1296_,
  accountpro0_.SECONDARY_FIRST_NM as SECONDARY12_1296_,
  accountpro0_.SECONDARY_LAST_NM as SECONDARY13_1296_,
  accountpro0_.COMPANY_NM as COMPANY14_1296_,
  accountpro0_.NAME_SEARCH_KEY as NAME15_1296_,
  accountpro0_.EMAIL as EMAIL1296_,
  accountpro0_.IP_NBR as IP17_1296_,
  accountpro0_.RELA_NBR as RELA18_1296_,
  accountpro0_.UNRECONCILED_IND as UNRECON19_1296_,
  accountpro0_.XML_DATA_TXT as XML20_1296_
from
  TV.ACCOUNT_PROFILE accountpro0_


Then, upon manual execution, I get the same stack trace and error as above.

Code:
java.lang.NullPointerException
   at org.hibernate.impl.SessionFactoryImpl.getReturnAliases(SessionFactoryImpl.java:621)
   at org.hibernate.impl.AbstractQueryImpl.getReturnAliases(AbstractQueryImpl.java:156)
   at org.hibernate.console.HQLQueryPage.getPathNames(HQLQueryPage.java:95)
   at org.hibernate.eclipse.console.views.QueryPageViewer.addColumnsToTable(QueryPageViewer.java:215)
   at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:170)
   at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:153)
   at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:111)
   at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:88)
   at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:52)
   at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:62)
   at javax.swing.AbstractListModel.fireIntervalAdded(AbstractListModel.java:130)
   at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50)
   at org.hibernate.console.KnownConfigurations$1.queryPageCreated(KnownConfigurations.java:60)
   at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:306)
   at org.hibernate.console.ConsoleConfiguration.access$5(ConsoleConfiguration.java:302)
   at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:295)
   at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
   at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:287)
   at org.hibernate.eclipse.console.actions.ExecuteHQLAction.execute(ExecuteHQLAction.java:134)
   at org.hibernate.eclipse.console.actions.ExecuteHQLAction.run(ExecuteHQLAction.java:116)
   at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
   at org.hibernate.eclipse.console.actions.ExecuteHQLAction.runWithEvent(ExecuteHQLAction.java:120)
   at org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:222)
   at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:228)
   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$6.handleEvent(ActionContributionItem.java:441)
   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:3080)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
   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)


as well as another one (with no trace)

"Unhandled event loop exception"

Thanks so much,
Matt


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 3:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what version of the tools are you using exactly ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: version
PostPosted: Tue Jan 10, 2006 2:21 pm 
Newbie

Joined: Mon Jan 09, 2006 4:44 pm
Posts: 5
I'm using Hibernate Tools 3.1.0 beta 2. Sorry, forgot to include that.

Interestingly, I fired up Eclipse again this morning, and found that I was able to get some queries to work (the same queries that failed previously). I don't know what caused this. I did get the reverse-engineering working, then the next day I installed Eclipse Web Tools, and the HQL queries never worked. Then, the day after (today, in other words), the queries started working.

I think there are a few gotchas working with Hibernate in Eclipse. For example, it's not directly related, but a simple class I was working with yesterday gave me all sorts of CGLIB related "NoClassDefFoundError" problems, when running my program in the Eclipse java runner. When I invoked the same class using Ant (in Eclipse), it worked just fine.

If you have any ideas on what caused this, or how I could avoid it in the future, that would help improve my understanding of hibernate and the tools.

Tak for hjaelpen, Max!

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 3:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
make sure you are using the proper WTP versions.

...having issue with classnotfound and other fun is most likely caused by you having too little or too much on the classpath of the console configuration:

too little is when you dont include the classpath of the pojo's and its dependent classes

too much is when you start including hibernate jars which then will conflict with the jars the hibernate that is running inside the eclipse plugin core has.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 10, 2006 3:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
...og selv tak igen da; ikke meget du afsloerer i din profil om dit dansk ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.