-->
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.  [ 35 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: GenericJDBCException:Getting database metadata
PostPosted: Fri Jun 10, 2005 10:59 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 10:34 am
Posts: 20
Hibernate version:
Hibernate 3.0

Name and version of the database you are using:
Oracle 8.1.7

JDBC Driver:
Oracle JDBC driver for Oracle 8i : classes12.jar

hibernate.cfg.xml configuration File:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
       <property name="hibernate.show_sql">true</property>
        <property name="hibernate.connection.username">use</property>
        <property name="hibernate.connection.password">pass</property>
        <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
        <property name="hibernate.connection.url">jdbc:oracle:thin:@myServer:MySID</property>
        <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    </session-factory>
</hibernate-configuration>


Error Summary
I have a GenericJDBCException thrown when I try to use the Hibernate Artifact Generation wizard of the Hibernate Tools alpha4 plugin for Eclipse IDE.
I've add the Oracle driver jar to the classpath in the Hibernate console Configuration, and I'm sure it is the good version for my dataBase.

Is it possible to have more informations about the reason that causes the exception to be thrown such as a "hibernateError.log" ? Because the Exception that is thrown seems to be the more Generic Hibernate JDBC Exception and do not give me any informations about the problem that occurs.

Also, if anybody had the same problem or thinks he knows where the problem comes from, he's welcome :D

Hope my English's not too bad ... French man speaking English ... ;)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 10, 2005 2:39 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
as noted in docs: See in the Error Log View

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: More informations
PostPosted: Mon Jun 13, 2005 3:26 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 10:34 am
Posts: 20
I have more informations about the problem. Here is what the Error Log View says :
Code:
org.hibernate.exception.GenericJDBCException: Reading from database
   at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
   at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
   at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:96)
   at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:37)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:237)
   at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:77)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:234)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:164)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:132)
   at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:98)
   at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:111)
[***]Caused by: java.sql.SQLException: ORA-01000: Nombre maximum de curseurs ouverts atteint[***]

   at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:169)
   at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
   at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:118)
   at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:466)
   at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:441)
   at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:460)
   at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:185)
   at oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedStatement.java:168)
   at oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleConnection.java:614)
   at oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:492)
   at oracle.jdbc.OracleDatabaseMetaData.getColumns(OracleDatabaseMetaData.java:2535)
   at org.hibernate.cfg.JDBCBinder.processBasicColumns(JDBCBinder.java:732)
   at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:123)
   at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:91)
   ... 8 more


All my attention goes to the error line that I've marked with [***]. The english translation of it :
Caused by: java.sql.SQLException: ORA-01000: Maximum number of cursor reached

So it seems that the problem comes from the database cursor settings.
I don't know what do you exactly. Increase the number of cursor of my database ? What is the default value of it ? and how many cursor does Hibernate needs to retrieve database information by JDBC access ?

Thanks for helping


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 3:32 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
use the new alpha4 release - this bug is in alpha1

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 3:38 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 10:34 am
Posts: 20
Humm sorry, I'm using the new alpha4 release ... And there isn't any old jars or directory of the alpha1 release in my plugin directory of Eclipse.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 3:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
weird - haven't been able to reproduce this on oracle...

normally the work around is to set default schema and catalog to what you need and it should work.

how many tables are you processing ? (it should not matter since we only open one resultset at the time, but just so i know more)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 3:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
weird - haven't been able to reproduce this on oracle...

normally the work around is to set default schema and catalog to what you need and it should work.

how many tables are you processing ? (it should not matter since we only open one resultset at the time, but just so i know more)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 4:08 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 10:34 am
Posts: 20
There's more than 150 tables in the database. I also thought about the
Code:
default-schema
property, I'm going to look at this.
I made some research about this ORA-01000 error. It is linked to an important number of triggers and opened session. More informations later ... I'm going to do it GrrRrr ;)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 4:14 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I just chekked the code. AFAIK we close every resultset in a finally block so it should not leak anything.

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: An other error ...
PostPosted: Mon Jun 13, 2005 4:15 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 10:34 am
Posts: 20
If it could help, here is the error that occurs when I double-click on "Mapped Entities" in the Hibernate Console view :

Code:
Message : unexpected end of subtree []

Exception Stack trace :
org.hibernate.hql.ast.QuerySyntaxError: unexpected end of subtree []
   at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:63)
   at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:196)
   at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
   at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
   at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
   at org.hibernate.impl.SessionFactoryImpl.getRepresentativeQuery(SessionFactoryImpl.java:675)
   at org.hibernate.impl.SessionFactoryImpl.getReturnTypes(SessionFactoryImpl.java:665)
   at org.hibernate.impl.AbstractQueryImpl.getReturnTypes(AbstractQueryImpl.java:483)
   at org.hibernate.console.HQLQueryPage.getPathNames(HQLQueryPage.java:73)
   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:83)
   at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:52)
   at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:57)
   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:266)
   at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:247)
   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:1015)
   at org.eclipse.core.runtime.Platform.run(Platform.java:757)
   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:842)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2908)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2541)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1612)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1578)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:293)
   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:228)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:333)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:150)
   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:585)
   at org.eclipse.core.launcher.Main.invokeFramework(Main.java:268)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:260)
   at org.eclipse.core.launcher.Main.run(Main.java:887)
   at org.eclipse.core.launcher.Main.main(Main.java:871)
Caused by: <AST>:0:0: unexpected end of subtree
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2724)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:513)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:371)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:201)
   at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:151)
   at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189)
   ... 50 more


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 4:22 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
huh ? this is not related to the ORA error is it ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 4:36 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 10:34 am
Posts: 20
The ORA error occurs when I try do the Hibernate Artifact Generation.
The second one by double-clicking on "mapped entities"in the Hibernate Console View


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 4:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
two different things ,)

the double click looks like a stupid bug where I forget to check if the node actually can be used for a query....in this case Mapped Entities doesnt ,)

does your mapped entities contain anything when you click the + ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 4:48 am 
Beginner
Beginner

Joined: Fri Jun 10, 2005 10:34 am
Posts: 20
No, the mapped entities doesn't contain anything (no "+" either), impossible to get any database information.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 4:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ok, makes sense since your configuration does not contain anything if it couldnt read from the database.

Also try and see if setting up a .reveng.xml can help you - e.g. make it exclude everything you dont want and include everything you do want.

See the docs for how.

_________________
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.  [ 35 posts ]  Go to page 1, 2, 3  Next

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.