This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MySQL Tomcat JDBC DataSource problem

 
Mahesh Chandran
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • 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
 
Rob Spoor
Sheriff
Pie
Posts: 20531
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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
Pie
Posts: 20531
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic