-->
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.  [ 1 post ] 
Author Message
 Post subject: Eclipse Hibernate Console database issue
PostPosted: Wed Feb 02, 2005 2:12 am 
Newbie

Joined: Tue Feb 01, 2005 12:23 am
Posts: 1
Location: Melbourne, Australia
I'm having some trouble with the Eclipse Hibernate Console.
I can create a SessionFactory with no trouble, and all my classes show up and look ok, but when I double-click on them to execute a query I get the exception detailed below.
This happens with ~14 out of the 17 classes I've written, but the other 3 work fine (they just return an empty result set, which is correct). I assume that there is no problem with the database connection, as 3 of the classes don't return errors...

Hibernate version:
I'm using Hibernate 3 Beta 3

Name and version of the database you are using:
HSQLDB 1.7.3.2

hibernate.cfg.xml:
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="hibernate.connection.url">jdbc:hsqldb:data/possumdata</property>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
</session-factory>

</hibernate-configuration>

hibernate-console.xml:
<?xml version="1.0" encoding="UTF-8"?>
<hibernate-console>
<configuration name="Possum">
<hibernate-config-xml location="/Possum/hibernate.cfg.xml"/>
<mappings>
<mapping location="/Possum/net/possum/model/SyndromePatientRelationship.hbm.xml"/>
<mapping location="/Possum/net/possum/model/Syndrome.hbm.xml"/>
<mapping location="/Possum/net/possum/model/Phone.hbm.xml"/>
<mapping location="/Possum/net/possum/model/PersistentProperties.hbm.xml"/>
<mapping location="/Possum/net/possum/model/Patient.hbm.xml"/>
<mapping location="/Possum/net/possum/model/MediaRepresentation.hbm.xml"/>
<mapping location="/Possum/net/possum/model/MediaContext.hbm.xml"/>
<mapping location="/Possum/net/possum/model/MediaBox.hbm.xml"/>
<mapping location="/Possum/net/possum/model/Media.hbm.xml"/>
<mapping location="/Possum/net/possum/model/Country.hbm.xml"/>
<mapping location="/Possum/net/possum/model/Contact.hbm.xml"/>
<mapping location="/Possum/net/possum/model/Citation.hbm.xml"/>
<mapping location="/Possum/net/possum/model/Category.hbm.xml"/>
<mapping location="/Possum/net/possum/model/AccessionedObject.hbm.xml"/>
</mappings>
<classpath>
<path location="/Possum/classes.zip"/>
<path location="/Possum/lib/hsqldb.jar"/>
</classpath>
</configuration>
</hibernate-console>

The generated SQL (show_sql=true):
The SQL shown in the exception is:
[select accessione0_.ID as ID, accessione0_.SAA_ID as SAA_ID20_, accessione0_.ageRangeNumber as ageRange4_20_, accessione0_.comment as comment20_, accessione0_.name as name20_, accessione0_.SYNDROME_ID as SYNDROME7_20_, accessione0_.PAA_ID as PAA_ID20_, accessione0_.ageInDays as ageInDays20_, accessione0_.PATIENT_ID as PATIENT_ID20_, accessione0_.TRAIT_ID as TRAIT_ID20_, accessione0_.groupNum as groupNum20_, accessione0_.patientScore as patient13_20_, accessione0_.syndromeScore as syndrom14_20_, accessione0_.isGroup as isGroup20_, accessione0_.CATEGORY_ID as CATEGOR16_20_, accessione0_.TYPE as TYPE from ACCESSIONED_OBJECT accessione0_]

Full stack trace of any exception that occurs:
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:70)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1363)
at org.hibernate.loader.Loader.list(Loader.java:1343)
at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:872)
at org.hibernate.impl.SessionImpl.find(SessionImpl.java:973)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:30)
at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:74)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:766)
at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:708)
at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:823)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:725)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:706)
at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1172)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1109)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1170)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1129)
at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:667)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:248)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1314)
at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:168)
at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:147)
at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:105)
at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:78)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:47)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:52)
at javax.swing.AbstractListModel.fireIntervalAdded(AbstractListModel.java:130)
at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50)
at org.hibernate.console.KnownConfigurations$3.queryPageCreated(KnownConfigurations.java:167)
at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:265)
at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:246)
at org.hibernate.eclipse.console.views.KnownConfigurationsView$5.run(KnownConfigurationsView.java:143)
at org.hibernate.eclipse.console.views.KnownConfigurationsView$3.doubleClick(KnownConfigurationsView.java:91)
at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:638)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:747)
at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:636)
at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:858)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:965)
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:82)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1232)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1256)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1241)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1089)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2900)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2568)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1569)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1540)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:285)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:220)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
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.basicRun(Main.java:185)
at org.eclipse.core.launcher.Main.run(Main.java:710)
at org.eclipse.core.launcher.Main.main(Main.java:694)
Caused by: java.sql.SQLException: Table not found: ACCESSIONED_OBJECT in statement [select accessione0_.ID as ID, accessione0_.SAA_ID as SAA_ID20_, accessione0_.ageRangeNumber as ageRange4_20_, accessione0_.comment as comment20_, accessione0_.name as name20_, accessione0_.SYNDROME_ID as SYNDROME7_20_, accessione0_.PAA_ID as PAA_ID20_, accessione0_.ageInDays as ageInDays20_, accessione0_.PATIENT_ID as PATIENT_ID20_, accessione0_.TRAIT_ID as TRAIT_ID20_, accessione0_.groupNum as groupNum20_, accessione0_.patientScore as patient13_20_, accessione0_.syndromeScore as syndrom14_20_, accessione0_.isGroup as isGroup20_, accessione0_.CATEGORY_ID as CATEGOR16_20_, accessione0_.TYPE as TYPE from ACCESSIONED_OBJECT accessione0_]
at org.hsqldb.jdbc.jdbcUtil.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:356)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:307)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:86)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1016)
at org.hibernate.loader.Loader.doQuery(Loader.java:348)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:195)
at org.hibernate.loader.Loader.doList(Loader.java:1360)
... 62 more



Thanks in advance :)


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

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.