Context specific JNDI parameters problem in tomcat 6

前端 未结 3 1756
无人及你
无人及你 2021-02-14 18:56

I am having trouble using JNDI when two or more applications are deployed on Tomcat 6. Consider the following scenario: I have 2 webapps, where each web.xml contains one JNDI pa

3条回答
  •  情书的邮戳
    2021-02-14 19:53

    BTW,

    1. you do NOT need stuff in web.xml.
    2. you do not need to modify /tomcat6/conf/context.xml

    All you need is to put context.xml in your META-INF of WebContent directory inside war. The JNDI will be register automatically, and pool will be created on application load.

    Only optionally, you can put it in /tomcat6/conf/context.xml, but this will require restart of tomcat after each configuration change.

    Here is some good configuration for my sql. Important point is logAbandoned (to detect unclosed connections that were thrown out of pool by container, because your code forgot to close it). For validation query i suggest something to test your database table presence.

    
    

提交回复
热议问题