• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

tomcat connection pooling

 
greenhorn
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where did you put your JDBC driver?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
reply
    Bookmark Topic Watch Topic
  • New Topic