Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

tomcat connection pooling

 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using mysql db.

here is what i am doing:

1. following entries in server.xml:



2. folling code in my context listener:


when i start the server, i get following exception:



i follow following link: http://www.onjava.com/pub/a/onjava/2006/04/19/database-connection-pooling-with-tomcat.html?page=2

please help.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, instead of using the onJava article, why aren't you using the current Tomct documentation for the version of Tomcat that you're running?

I don't know how old that article is but the Tomcat documentation has advised against putting <Context .../> entries in server.xml since version 5.0.
 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
Where did you put your JDBC driver?


i keep it (mysql.jar) into lib folder of tomcat.
 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
Where did you put your JDBC driver?


i keep it (mysql.jar) into lib folder of tomcat.
 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
Also, instead of using the onJava article, why aren't you using the current Tomct documentation for the version of Tomcat that you're running?

I don't know how old that article is but the Tomcat documentation has advised against putting <Context .../> entries in server.xml since version 5.0.


okay. its mentioned. and it can be mentioned at following places:



1. context.xml already have a context element. should i replace it?
2. in 2nd and 3rd option, there is no engine name and host name folder in my system.
3. in 4th, i dont have META-INF folder in my application.
4. in 5th, isn't it modifying host tag is equivalent to modifying context tag? both are common for all application deployed on this tomcat.
 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

inside a Host element in the main conf/server.xml


now i placed context tag inside host tag of server.xml file but still the same error.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My point was that you'd be better off using the documentation on the Tomcat site; especially if you use the one that is matched to the exact version of Tomcat that you're using.

If something changed since that magazine article was written, it will throw you off.
 
pooja jain
greenhorn
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
My point was that you'd be better off using the documentation on the Tomcat site; especially if you use the one that is matched to the exact version of Tomcat that you're using.

If something changed since that magazine article was written, it will throw you off.


i understood. now i am referring tomcat site but still the same error.
 
Pushkal Mishra
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pooja,

I take it that you have also modified the necessary element in web.xml (<resource-ref>).

Thanks,
Pushkal

Originally posted by pooja jain:


okay. its mentioned. and it can be mentioned at following places:



1. context.xml already have a context element. should i replace it?
2. in 2nd and 3rd option, there is no engine name and host name folder in my system.
3. in 4th, i dont have META-INF folder in my application.
4. in 5th, isn't it modifying host tag is equivalent to modifying context tag? both are common for all application deployed on this tomcat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic