-->
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.  [ 3 posts ] 
Author Message
 Post subject: MS SQL 2K - HB3.0 - AbstractMethodError:
PostPosted: Thu Jun 02, 2005 11:41 am 
Newbie

Joined: Thu Jun 02, 2005 11:20 am
Posts: 9
Hi all,

I'm getting a strange error here and I don't think it's a bug, so I must be doing something wrong.

Environment:

Windows 2K3 Server w/ SQL Server 2K SP3
Microsoft JDBC Drivers for SQL 2K SP3
Hibernate 3.0
Sun JDK 1.4.2_05

When I try to start Hibernate, it seems to connect and then call getDatabaseMajorVersion which craps out to this error:

- Hibernate 3.0.4
- hibernate.properties not found
- using CGLIB reflection optimizer
- using JDK 1.4 java.sql.Timestamp handling
- configuring from resource: /hibernate.cfg.xml
- Configuration resource: /hibernate.cfg.xml
- Mapping resource: com/interwoven/solutions/personalization/SolutionGroup.hbm.xml
- Mapping class: com.interwoven.solutions.personalization.SolutionGroup -> iws_group
- Configured SessionFactory: null
- processing extends queue
- processing collection mappings
- processing association property references
- processing foreign key constraints
- Initializing connection provider: org.hibernate.connection.DBCPConnectionProvider
- active: 0 (max: 5) idle: 3(max: 8)
- active: 1 (max: 5) idle: 2(max: 8)
- active: 0 (max: 5) idle: 3(max: 8)
Initial SessionFactory creation failed.java.lang.AbstractMethodError: com.microsoft.jdbc.base.BaseDatabaseMetaData.getDatabaseMajorVersion()I
java.lang.ExceptionInInitializerError
at com.interwoven.solutions.hibernate.HibernateUtil.<clinit>(Unknown Source)
at com.interwoven.solutions.personalization.SolutionUserTest.main(Unknown Source)

Here's my connection info:

<!-- Database connection settings -->
<property name="connection.driver_class">com.microsoft.jdbc.sqlserver.SQLServerDriver</property>
<property name="connection.url">jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=solutions;SelectMethod=Cursor</property>
<property name="connection.username">solutions</property>
<property name="connection.password">foo</property>

<property name="connection.provider_class">org.hibernate.connection.DBCPConnectionProvider</property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">5</property>

I looked through the source in org.hibernate.cfg.SettingsFactory and on line 75 I see this call:

databaseMajorVersion = meta.getDatabaseMajorVersion();

Since this happens by default when hibernate starts, someone else MUST have run across this same issue or else no one would be able to connect to MS SQL instances?

FYI, I wrote a little test harness using straight-up Commons DBCP and I get the same error when I issue the above call ( getDatabaseMajorVersion ). Did M$ not implement this method in their driver?!

Thanks in advance for any/all help!

Shanon


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 02, 2005 12:07 pm 
Expert
Expert

Joined: Sat Jan 17, 2004 2:57 pm
Posts: 329
Location: In the basement in my underwear
Upgrade to 3.0.5, that should fix the issue. I think what you're seeing is the bug where a JDBC 3 method was getting called and it wasn't widely supported.

http://forum.hibernate.org/viewtopic.ph ... jorversion


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 02, 2005 12:16 pm 
Newbie

Joined: Thu Jun 02, 2005 11:20 am
Posts: 9
Vamp --

Thanks much for this.

Shanon


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