-->
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.  [ 9 posts ] 
Author Message
 Post subject: Please Help: Not Able To Run 1st Hibernate Program...
PostPosted: Sat Jan 23, 2010 9:39 am 
Newbie

Joined: Sat Jan 23, 2010 9:23 am
Posts: 3
Hi,

Issue:
-----

Created simple Java Application with Hibernate 3.0 over Oracle 8i.

While executing it getting following error message:

Initial SessionFactory Creaion Failed.java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.supportsGetGeneratedKeys()Z
Exception in thread "main" java.lang.ExceptionInInitializerError
at HibernateUtil.buildSessionFactory(HibernateUtil.java:27)
at HibernateUtil.<clinit>(HibernateUtil.java:17)
at EvenManager.createAndStoreEvent(EvenManager.java:33)
at EvenManager.main(EvenManager.java:26)
Caused by: java.lang.AbstractMethodError: oracle.jdbc.driver.OracleDatabaseMetaData.supportsGetGeneratedKeys()Z
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:123)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)
at HibernateUtil.buildSessionFactory(HibernateUtil.java:23)
... 3 more



While decompiling SettingFactory.class & OracleDataBaseMetaData.class I found that implementation of "supportsGetGeneratedKeys()" method is missing in OracleDataBaseMetaData.java because of which I am getting "AbstractMethodError" exception.

I am using "classes12.zip" for the Oracle-Thin Driver (FYI)


I shall be obliged if anyone can suggest me the root cause of the same.

Cheers,
Gajendra Singh Tomer (SCJP 5.0,SCWCD 5.0, ITIL V3.0)


Top
 Profile  
 
 Post subject: Re: Please Help: Not Able To Run 1st Hibernate Program...
PostPosted: Mon Jan 25, 2010 9:32 am 
Newbie

Joined: Sat Jan 23, 2010 9:23 am
Posts: 3
Further into my analysis I found that I am using Oracle 8i with Hibernate 3.0 may be because of that I am getting AbstractMethodError exception.

This is so because OracleDatabaseMetaData class of Oracle8i doesn't support DataBaseMetaData interface of Hibernate3.0.

Comment please:)

Regards,
Gajendra


Top
 Profile  
 
 Post subject: Re: Please Help: Not Able To Run 1st Hibernate Program...
PostPosted: Mon Jan 25, 2010 9:56 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Hi Gajendra,

The DataBaseMetaData you mention is not an interface of Hibernate3.0,
It is java.sql.DataBaseMetaData and therefore part of the java runtime.
Most probably you are using a very old or uncomplete jdbc-driver.
Do you use the latest jdbc-driver for oracle8 ?

Guenther


Top
 Profile  
 
 Post subject: Re: Please Help: Not Able To Run 1st Hibernate Program...
PostPosted: Wed Jan 27, 2010 8:23 am 
Newbie

Joined: Sat Jan 23, 2010 9:23 am
Posts: 3
Hi Guenther !

Thanks for the response.
You are right that "DatabaseMetaData" interface is provided by Java.
So it's not a problem of Hibernate. Agreed!
I am using Type-4 JDBC Driver Of Oracle having version 8.1.7.

Don't know is there any other driver more latest than this for Oracle8i.

Let me see into that but if you know then please let me know.

I shall be thankful to you.

Warm Regards,
Gajendra Singh Tomer


Top
 Profile  
 
 Post subject: Re: Please Help: Not Able To Run 1st Hibernate Program...
PostPosted: Mon Mar 15, 2010 2:44 pm 
Newbie

Joined: Wed Sep 03, 2008 12:46 pm
Posts: 6
Did you by any chance find a resolution to your problem? I'm experiencing the exact same issue. However, in my case I'm using Oracle 10 with a very old 1.4 version of the JDK (which I don't have the option to upgrade). I'm wondering if this combination is possible for use with Hibernate 3.


Top
 Profile  
 
 Post subject: Re: Please Help: Not Able To Run 1st Hibernate Program...
PostPosted: Mon Mar 15, 2010 5:39 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
There may be some configuration options that if disabled may help solve this problem. Seems like the problem in the original post could have something to do with the 'hibernate.jdbc.use_get_generated_keys' option. Read http://docs.jboss.org/hibernate/stable/ ... n-optional for more information.


Top
 Profile  
 
 Post subject: Re: Please Help: Not Able To Run 1st Hibernate Program...
PostPosted: Tue Mar 16, 2010 7:18 am 
Beginner
Beginner

Joined: Thu Jul 24, 2008 3:33 am
Posts: 20
I have the same problem and I noticed a change in org.hibernate.cfg.SettingsFactory:
    - in hibernate 3.2.7.ga the code checked for the presence of supportsGetGeneratedKeys and therefore works fine
    - in hibernate-core 3.3.2.GA the code just calls the function without checking and therefore fails

hibernate.jdbc.use_get_generated_keys doesn't prevent this.
So the question is: why did they change the code in 3.3.2?

Regards, CL


Top
 Profile  
 
 Post subject: Re: Please Help: Not Able To Run 1st Hibernate Program...
PostPosted: Tue Mar 16, 2010 9:34 am 
Newbie

Joined: Wed Sep 03, 2008 12:46 pm
Posts: 6
Thanks for the catch, CL. I've created a bug report for this at http://opensource.atlassian.com/project ... e/HHH-5017. It's my first time filing a Hibernate bug report, so I'll probably get my hand slapped for leaving something out or breaching etiquette in some way. When I get into the office I'll try to add some test case information for my own situation... if anyone else wants to add anything to the ticket, the link is above.


Top
 Profile  
 
 Post subject: Re: Please Help: Not Able To Run 1st Hibernate Program...
PostPosted: Tue Mar 16, 2010 9:57 am 
Beginner
Beginner

Joined: Thu Jul 24, 2008 3:33 am
Posts: 20
The savety-check was removed in revision 15338, the comment was:
HHH-3525 : JDK 1.4 isolation reflection

The problem occurs also with DB2, not only Oracle.

Regards, Christian


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