Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

MySQL Tomcat JDBC DataSource problem

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am trying to setup a MySQL DataSource for Hibernate in Tomcat 6.0.6 application server. I am following the example from net.

The following are the steps that I did:

1. Copied MySQL JDBC Driver to CATALINA_LIB/lib folder. (Tried copying it to CATALINA_LIB/common/lib as well - same result).
2. In application Context.xml created the following entry for Resource:


3. Created ResourceRef in web.xml as follows:



4. Then added the following code in index.jsp:


I get the exception:




I know that this error has been discussed over and over again. I think I am following most of the suggestions. But don't know where I am getting it wrong. Can anyone point out the mistake that I am doing here.

Thanks
Mahesh
 
Sheriff
Posts: 22152
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat 6 has changed the way resources are handled. Instead of a Resource element and a separate ResourceParams element they go into one element now:
 
Mahesh Chandran
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

I tried this out myself too. It works now like magic.

Appreciate your inputs

Thanks
Mahesh
 
Rob Spoor
Sheriff
Posts: 22152
117
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome. I ran into the same problem when switching from Tomcat 5 to Tomcat 6, so I know how frustrating this issue can be.
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic