• 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
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • 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: 22650
126
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: 22650
126
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.
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic