Hibernate & Netbeans cannot find JDBC Driver

I have setup hibernate in Netbeans. Testing with local class I can get the Hibernate SessionFactory successfully. But when run as web app it throws an exception that "JDBC Driver class not found: oracle.jdbc.driver.OracleDriver". I have added the oracle driver to the libraries. Even added to tomcat server and common folder but still cant find the driver. When I check in the deployed war file I can see the jdbc driver zip file there.

Is there any other location to add the drivers?

Many thanks

Ahmad

[527 byte] By [A.Khana] at [2007-11-26 14:17:49]
# 1
Tomcat won't deal with ZIP files. Make it a JAR and see if that helps. Otherwise you still haven't put it in the CLASSPATH properly. Just to be clear, you should have odjbc14.jar in the Tomcat common/lib directory, right?%
duffymoa at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

Tomcat is able to deal with zip files. Once added to library of the web application it should be enough, but any how I have added to common/lib as well but still the same issue. I had another installation of tomcat (not bundled with netbeans) ver 5.5.9 after adding this server to netbeans it worked fine and was able to find the drivers.

The bundled one behaves unexpectedly for the tomcat-users.xml as well. even after removing all the users still I can use the tomcat and role1 users. I am not sure if it is using any other users file other than the conf/tomcat-users.xml.

Many thanks

Ahmad

A.Khana at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

> Tomcat is able to deal with zip files.

No it isn't. Don't make that sort of statement without checking your facts.

Documented here:

http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

Plus I've double checked with a test case on my Tomcat 5.5 installation.

The tomcat users question is unrelated - very probably you've pointed the server config at a different tomcat-users.xml file, or you're using a completely different Realm (e.g. DB).

(edit) I would also add that WEB-INF/lib is almost always the wrong place to put the JDBC driver. It should exist only in common/lib if you plan to access it as a DataSource

dcmintera at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4

> > Tomcat is able to deal with zip files.

>

> No it isn't. Don't make that sort of statement

> without checking your facts.

>

Sorry, Dave. You're 100% right. I left out the "not" by mistake.

> Documented here:

> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasourc

> e-examples-howto.html

>

> Plus I've double checked with a test case on my

> Tomcat 5.5 installation.

>

> The tomcat users question is unrelated - very

> probably you've pointed the server config at a

> different tomcat-users.xml file, or you're using a

> completely different Realm (e.g. DB).

>

> (edit) I would also add that WEB-INF/lib is almost

> always the wrong place to put the JDBC driver. It

> should exist only in common/lib if you plan to

> access it as a DataSource

Correct again. 8( Another poor thread for me.

%

duffymoa at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5
> Sorry, Dave. You're 100% right. I left out the> "not" by mistake.Er...? I'm correcting him, not you - yours was on the money.> Another poor thread for me.Possibly not for the reason you originally meant :-)D.
dcmintera at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 6

> > Sorry, Dave. You're 100% right. I left out the

> > "not" by mistake.

>

> Er...? I'm correcting him, not you - yours was on the

> money.

Oh! I assumed it was me. That's how sketchy I am today.

>

> > Another poor thread for me.

>

> Possibly not for the reason you originally meant :-)

>

> D.

Whew! I thought I was losing it for a second. Maybe I am.

%

duffymoa at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 7
I'm pretty plotless myself today. Working with WebSphere. Shoot me.
dcmintera at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 8
> I'm pretty plotless myself today. Working with> WebSphere. Shoot me.I've never had the "pleasure", but I hear it's terrible. It sounds like a configuration nightmare.%
duffymoa at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 9
I figure it must have redeeming features. Still waiting to surprise one though.
dcmintera at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 10

Thanks for providing the link about tomcat and zip files.

When I said that tomcat can deal with zip file is because it is working perfectly ok with me. As I said after adding the new tomcat instance to netbeans using the same zip file drivers worked smoothly.

Probably I may be wrong some where.

Ahmad

A.Khana at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 11
If Tomcat is finding the driver then you also have the appropriate JAR file somewhere. Tomcat does not treat ZIP files as Java archives.
dcmintera at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 12
then You will remove # on Hibernate.properties file for Oracle orwill add jar file because tomcat 5 doest not support zip file
Gazia at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 13

I have a similar problem. I create a JAR library with the business logic, I use Hibernate and MySQL. Everything work fine but when I try use the JAR from a WebApp using the bundled TomCat on NetBeans 5.5 I got an server error. I believe that the problem is that the server don't know about Hibernate and the MySQL drive. I don't know well Tomcat, maybe you can help me.

Luiz_Siqueira_Netoa at 2007-7-8 2:08:24 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...