tomcat mysql中的数据源maxActive没有更改

tomcat mysql中的数据源maxActive没有更改,mysql,tomcat,jmx,Mysql,Tomcat,Jmx,我正在使用win7-eclipse-tomcat7-mysql5 首先,在TOMCAT_目录/conf/context.xml中设置数据源资源 <Context> <WatchedResource>WEB-INF/web.xml</WatchedResource> <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"

我正在使用win7-eclipse-tomcat7-mysql5

首先,在TOMCAT_目录/conf/context.xml中设置数据源资源

<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>

    <Resource name="jdbc/TestDB" auth="Container"
              type="javax.sql.DataSource"
              maxActive=100 maxIdle="30" maxWait="10000"
              username="dev_id" password="dev_password"
              driverClassName="com.mysql.jdbc.Driver"
              url="jdbc:mysql://localhost:3306/my_db_name" />
</Context>

WEB-INF/WEB.xml
在ECLIPSE/MY_PROJECT/WebContent/WEB-INF/WEB.xml中

  <resource-ref>
    <description>DB Connection</description>
    <res-ref-name>jdbc/TestDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>

数据库连接
jdbc/TestDB
javax.sql.DataSource
容器
设置之后,我运行EclipseTomcat7.0服务器

然后在jconsole中查找maxActive。


为什么maxActive不能更改??请帮帮我……

我终于找到了答案:)

在eclipse中,WTP有自己的设置

您可以在/server文件夹中看到tomcat服务器设置文件

如果运行EclipseWTP,TOMCAT_目录/conf/context.xml不会影响服务器。它只依赖于eclipse/server中的资源文件/