-->
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.  [ 8 posts ] 
Author Message
 Post subject: SQL Server 7 Problems
PostPosted: Wed Mar 03, 2004 5:40 pm 
Beginner
Beginner

Joined: Thu Feb 26, 2004 6:42 pm
Posts: 24
I am trying to get SQLServer7 working with Hibernate 2.1 and jdk 1.4.2 and trying to get the default example working. I get the following exception when I try to do so. The driver I am using is the JTurbo driver version 3.0(JTurbo 3.0.2 for JDBC 3.0 (Windows) ). When I try to connect using the Properties object(like hibernate uses) in a simple java class using jdbc, I am able to so without any problems at all. However I flip over to hibernate and start seeing this exception. Am totally lost, I was getting a connection reset error with Inet Sql Server driver and now this error with JTurbo from newatlanta. Help please!!!! I was able to get hibernate to work with oracle but I need to use SQLServer for this project and would like to use hibernate to be my data abstraction layer.

13:53:07,127 INFO Environment:462 - Hibernate 2.1.2
13:53:07,137 INFO Environment:491 - hibernate.properties not found
13:53:07,137 INFO Environment:519 - using CGLIB reflection optimizer
13:53:07,147 INFO Configuration:329 - Mapping resource: org/hibernate/auction/AuctionItem.hbm.xml
13:53:07,788 INFO Binder:229 - Mapping class: org.hibernate.auction.AuctionItem -> AuctionItem
13:53:07,908 INFO Configuration:329 - Mapping resource: org/hibernate/auction/Bid.hbm.xml
13:53:07,948 INFO Binder:229 - Mapping class: org.hibernate.auction.Bid -> Bid
13:53:07,998 INFO Binder:169 - Mapping subclass: org.hibernate.auction.BuyNow -> Bid
13:53:07,998 INFO Configuration:329 - Mapping resource: org/hibernate/auction/User.hbm.xml
13:53:08,058 INFO Binder:229 - Mapping class: org.hibernate.auction.User -> AuctionUser
13:53:08,248 INFO ReflectHelper:160 - reflection optimizer disabled for: org.hibernate.auction.Name, IllegalArgumentException: Cannot find matching method/constructor
13:53:08,278 INFO Configuration:595 - processing one-to-many association mappings
13:53:08,288 INFO Binder:1154 - Mapping collection: org.hibernate.auction.AuctionItem.bids -> Bid
13:53:08,288 INFO Binder:1154 - Mapping collection: org.hibernate.auction.User.bids -> Bid
13:53:08,288 INFO Binder:1154 - Mapping collection: org.hibernate.auction.User.auctions -> AuctionItem
13:53:08,288 INFO Configuration:604 - processing one-to-one association property references
13:53:08,288 INFO Configuration:629 - processing foreign key constraints
13:53:08,348 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.SQLServerDialect
13:53:08,358 INFO SettingsFactory:62 - Use outer join fetching: true
13:53:08,398 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
13:53:08,398 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
13:53:10,932 INFO DriverManagerConnectionProvider:71 - using driver: com.newatlanta.jturbo.driver.Driver at URL: jdbc:JTurbo//132.201.89.8:1433/FMLATest
13:53:10,932 INFO DriverManagerConnectionProvider:72 - connection properties: {user=fmla, password=fmlaowner01}
13:53:10,942 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
13:53:12,224 WARN SettingsFactory:95 - Could not obtain connection metadata
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:96)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1119)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:748)
at org.hibernate.auction.Main.main(Main.java:393)
13:53:12,224 INFO SettingsFactory:102 - Use scrollable result sets: false
13:53:12,224 INFO SettingsFactory:105 - Use JDBC3 getGeneratedKeys(): false
13:53:12,254 INFO SettingsFactory:108 - Optimize cache for minimal puts: false
13:53:12,254 INFO SettingsFactory:114 - echoing all SQL to stdout
13:53:12,254 INFO SettingsFactory:117 - Query language substitutions: {}
13:53:12,254 INFO SettingsFactory:128 - cache provider: net.sf.ehcache.hibernate.Provider
13:53:12,254 INFO Configuration:1080 - instantiating and configuring caches
13:53:12,284 INFO SessionFactoryImpl:119 - building session factory
13:53:12,695 INFO SessionFactoryObjectFactory:82 - no JNDI name configured
13:53:12,705 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.SQLServerDialect
13:53:12,705 INFO Configuration:595 - processing one-to-many association mappings
13:53:12,705 INFO Configuration:604 - processing one-to-one association property references
13:53:12,705 INFO Configuration:629 - processing foreign key constraints
13:53:12,705 INFO Configuration:595 - processing one-to-many association mappings
13:53:12,705 INFO Configuration:604 - processing one-to-one association property references
13:53:12,705 INFO Configuration:629 - processing foreign key constraints
13:53:12,705 INFO SchemaExport:98 - Running hbm2ddl schema export
13:53:12,705 INFO SchemaExport:117 - exporting generated schema to database
13:53:12,715 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
13:53:12,715 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
13:53:14,798 INFO DriverManagerConnectionProvider:71 - using driver: com.newatlanta.jturbo.driver.Driver at URL: jdbc:JTurbo//132.201.89.8:1433/FMLATest
13:53:14,798 INFO DriverManagerConnectionProvider:72 - connection properties: {user=fmla, password=fmlaowner01}
13:53:15,469 ERROR SchemaExport:165 - schema export unsuccessful
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:96)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:119)
at net.sf.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:84)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:198)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:750)
at org.hibernate.auction.Main.main(Main.java:393)
Setting up some test data
13:53:15,489 INFO DriverManagerConnectionProvider:138 - cleaning up connection pool: jdbc:JTurbo//132.201.89.8:1433/FMLATest
13:53:18,343 WARN JDBCExceptionReporter:38 - SQL Error: 0, SQLState: 08001
13:53:18,343 ERROR JDBCExceptionReporter:46 - No suitable driver
13:53:18,353 ERROR JDBCExceptionReporter:38 - Cannot open connection
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:96)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3264)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3244)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2195)
at org.hibernate.auction.Main.createTestAuctions(Main.java:283)
at org.hibernate.auction.Main.main(Main.java:395)
net.sf.hibernate.JDBCException: Cannot open connection
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:281)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3264)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3244)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2195)
at org.hibernate.auction.Main.createTestAuctions(Main.java:283)
at org.hibernate.auction.Main.main(Main.java:395)
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:96)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278)
... 7 more


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 03, 2004 6:04 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Try to open a conenction wo Hibernate

_________________
Emmanuel


Top
 Profile  
 
 Post subject: response
PostPosted: Wed Mar 03, 2004 6:06 pm 
Beginner
Beginner

Joined: Thu Feb 26, 2004 6:42 pm
Posts: 24
I tried to open a connection without hibernate in the same eclipse project(hence the same properties) with simple jdbc code and it works. I got the reponse too. I have tried executing this example in my eclipse project as well as via the ant script after modifying hibernate.properties to no avail.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 03, 2004 6:12 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Sometimes, drivers not properly configured (url etc) raise such exception.
The other way is not having the driver in the CP.
Double check hibernate.properties (extra space etc)

_________________
Emmanuel


Top
 Profile  
 
 Post subject: still now working
PostPosted: Wed Mar 03, 2004 6:19 pm 
Beginner
Beginner

Joined: Thu Feb 26, 2004 6:42 pm
Posts: 24
I copied the driver url from my working jdbc code, I checked to make sure there are no extra spaces or anything in hibernate.properties. I also made sure that the jar file was copied over into the hibernate.home/lib directory. Here is what I have in my hibernate.properties


hibernate.dialect net.sf.hibernate.dialect.SQLServerDialect
hibernate.connection.driver_class com.newatlanta.jturbo.driver.Driver
hibernate.connection.url jdbc:JTurbo//132.201.89.8:1433/FMLATest
hibernate.connection.username fmla
hibernate.connection.password fmlaowner01

I have set connection pool to 0 to make sure its not using pooling and set scrollable resultsets to false. Dont know what else to try.

Sometimes, drivers not properly configured (url etc) raise such exception.
The other way is not having the driver in the CP.
Double check hibernate.properties (extra space etc)
_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 03, 2004 6:25 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
What do you mean by hibernate.home/lib ? Hibernate2.jar and your driver must be in the same CP

_________________
Emmanuel


Top
 Profile  
 
 Post subject: re:
PostPosted: Wed Mar 03, 2004 6:29 pm 
Beginner
Beginner

Joined: Thu Feb 26, 2004 6:42 pm
Posts: 24
I have hibernate installed in C:\software\hibernate
and so I meant C:\software\hibernate\lib by that. The ant eg target picks up everything under lib. I also copied the jar file over to where I have hibernate2.jar but still same problem persists.


Top
 Profile  
 
 Post subject: clover a problem?
PostPosted: Wed Mar 03, 2004 6:30 pm 
Beginner
Beginner

Joined: Thu Feb 26, 2004 6:42 pm
Posts: 24
I see this in logs on startup, is that a problem?

Buildfile: build.xml
[taskdef] Could not load definitions from resource clovertasks. It could not b
e found.

eg:


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