-->
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.  [ 4 posts ] 
Author Message
 Post subject: MSSQL - JDBC: Cannot create JDBC driver of class ''
PostPosted: Thu Nov 20, 2003 10:24 am 
Newbie

Joined: Thu Nov 13, 2003 6:09 am
Posts: 7
Hallo,

for testing hibernate I've written a little test program, keeping an eye on the Hibernate & Tomcat Quickstart document.

But when executing I get the following error:

1031 [http8080-Processor2] INFO impl.SessionFactoryImpl - Use outer join fetching: false
1031 [http8080-Processor2] WARN util.JDBCExceptionReporter - SQL Error: 0, SQLState: null
1031 [http8080-Processor2] ERROR util.JDBCExceptionReporter - Cannot create JDBC driver of class '' for connect URL 'null'
1047 [http8080-Processor2] WARN impl.SessionFactoryImpl - Could not obtain connection metadata
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:243)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:60)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:160)

I configured the database (MSSQL2000) in the server.xml:

<Context path="/demo" docBase="demo">

<Resource name="jdbc/demo" scope="Shareable" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/demo">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- DBCP database connection settings -->
<parameter>
<name>url</name>
<value>jdbc:microsoft:sqlserver://ASTERIX:1433;DatabaseName=Diplom</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.microsoft.jdbc.sqlserver.SQLServerDriver</value>
</parameter>

<parameter>
<name>username</name>
<value>sa</value>
</parameter>
<parameter>
<name>password</name>
<value>xxx</value>
</parameter>

To resolve a JNDI-Problem I inserted the following passage in the web.xml:

<resource-ref>
<res-ref-name>jdbc/demo</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

I use WSAD5.01, Tomcat 4.1.29, MSSQL 2000

I hope someone can help me.

Thanks,

Stephan


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 20, 2003 10:34 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
This error usually means you have copied some JARs in the wrong place, Tomcat is very picky about this. I recommend you do the following:

- Untar Tomcat again from a clean distribution
- Copy your JDBC driver JAR into common/lib/
- Don't copy _anything else_ into common/lib/
- Work with the example and Hibernate in a webapp folder only

If you still have problems, try to get a JDBC connection pool running in Tomcat without Hibernate.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 8:46 am 
Newbie

Joined: Thu Nov 13, 2003 6:09 am
Posts: 7
I have checked the four points you mentioned but nothing changed , the error still occures.

But I have read in other forums that this is a tomcat problem, but I didn't find out what the solution for the problem ;-(

Perhaps someone can provide a solution.

Thanks,

Stephan


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2003 8:56 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Try to get a JDBC connection without Hibernate and ask on the Tomcat user list.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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