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.  [ 26 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: reverse engineering from oracle
PostPosted: Wed Mar 23, 2005 3:51 pm 
Newbie

Joined: Wed Mar 23, 2005 1:02 pm
Posts: 8
Hi,
I am new to hibernate. I am trying to reverse engineer an oracle database schema using eclipse IDE. When I try to use Hibernate Artifact generation an exception is generated. Any suggestions? I did follow all the instructions in the documentation but I am not getting any further.

Here is the exception I am getting and my environment is eclipse 3.1M5+
Error under artifact generation :

Reason:
org.hibernate.exception.GenericJDBCException: Reading from database.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 23, 2005 4:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
need more from that stacktrace....it should be in the error view.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: reverse engineering from oracle
PostPosted: Wed Mar 23, 2005 4:37 pm 
Newbie

Joined: Wed Mar 23, 2005 1:02 pm
Posts: 8
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:125)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:213)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:111)
Caused by: java.sql.SQLException: ORA-01000: maximum open cursors exceeded
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:120)
at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:614)
at oracle.jdbc.driver.OracleStatement.open(OracleStatement.java:578)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2806)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:609)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:537)
at oracle.jdbc.driver.OracleDatabaseMetaData.getColumns(OracleDatabaseMetaData.java:242)
at org.hibernate.cfg.JDBCBinder.processBasicColumns(JDBCBinder.java:708)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:106)
... 8 more


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 23, 2005 5:42 pm 
Newbie

Joined: Wed Mar 23, 2005 1:02 pm
Posts: 8
Sorry about that max, I should have done more research. I will see other posts and let you know whatz happening.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 23, 2005 5:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
known bug and yes would have been found in the forums by a search ,)

fixed in cvs which im actually now bundling up with jbosside for a soon to be released ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 24, 2005 3:47 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Max,
is it enough that checkout contrib/jbosside for jbosside - I can't download complete jboss

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 24, 2005 3:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes that should be enough

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 4:25 pm 
Newbie

Joined: Wed Mar 23, 2005 1:02 pm
Posts: 8
Max,
I am still not able to generate POJO's for my database. I am not sure where I am messing it up. Here is my configuration file. It doesn't generate any error but it doesn't look like it creates any java files or mappings either. It only generates GeneralHbmSettings.hbm.xml.
This user has permissions for reading database metadata. Please let me know if I am doing anything wrong here.

<?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.connection.url">jdbc:oracle:thin:@salieri:1521:efttst</property>
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.connection.password">PASS</property>
<property name="hibernate.connection.username">EFT</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.default_schema">EFTTST</property>
<property name="hibernate.default_catalog"></property>
</session-factory>
</hibernate-configuration>

Thanks,
Prem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 5:03 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Have you got any tables in schema EFTTST and has user EFT permission ofr this tables ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 5:06 pm 
Newbie

Joined: Wed Mar 23, 2005 1:02 pm
Posts: 8
All the tables are in the EFTTST schema and EFT is a user.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 5:36 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Schema and user is same thing in oracle - You can't have schema EFTTST and user EFT

I think that you have tablespace EFTTST - schema is EFT and this will work

<property name="hibernate.default_schema">EFT</property>

except

<property name="hibernate.default_schema">EFTTST</property>

regards


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 5:44 pm 
Newbie

Joined: Wed Mar 23, 2005 1:02 pm
Posts: 8
I ran it with this but looks like it is generating a different error.
<?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.connection.url">jdbc:oracle:thin:@salieri:1521:efttst</property>
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.connection.password">D$V</property>
<property name="hibernate.connection.username">EFT</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.default_schema">EFT</property>
<property name="hibernate.default_catalog"></property>
</session-factory>
</hibernate-configuration>

org.hibernate.MappingException: Association references unmapped class: InquiryErrors
at org.hibernate.cfg.JDBCBinder.bindCollectionSecondPass(JDBCBinder.java:1178)
at org.hibernate.cfg.JDBCBinder$CollectionSecondPass.secondPass(JDBCBinder.java:1201)
at org.hibernate.cfg.HbmBinder$SecondPass.doSecondPass(HbmBinder.java:2052)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:830)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:801)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:218)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:111)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 5:52 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
you can foreign key to table in another schema (user), probably

have you table like InquiryError or INQUIRY_ERROR or like ...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 5:59 pm 
Newbie

Joined: Wed Mar 23, 2005 1:02 pm
Posts: 8
Yes it does have that table but when I checked, the owner of that table infact is EFT.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 6:05 pm 
Newbie

Joined: Wed Mar 23, 2005 1:02 pm
Posts: 8
Cool mate it works I tried it on another database and it generated all the classes. Thanks for your help mate...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 26 posts ]  Go to page 1, 2  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.