在网上搜了一下,改了后可是问题依旧。
我在Tomcat的Context.xml文件中添加了如下代码:
<Resource name="jdbc/net"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="5000"
username="root"
password="root"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/net">
</Resource>
Tomcat的server.xml配置如下:
<Context path="/whyk" docBase="D:\javaProject\Company2\WebRoot">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_MysqlTest_log." suffix=".txt"
timestamp="true"/>
<Resource name="jdbc/HBEGS_GJZJ" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/net">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>100</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>30</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>5000</value>
</parameter>
<parameter>
<name>username</name>
<value>root</value>
</parameter>
<parameter>
<name>password</name>
<value>root</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost:3306/net</value>
</parameter>
</ResourceParams>
</Context>
Tomcat6服务器可以启动,但是有以下警告:
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/Logger'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter/name'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter/value'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter/name'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter/value'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter/name'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter/value'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter/name'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter/value'.
2009-7-12 13:28:49 org.apache.tomcat.util.digester.Digester endElement
警告: No rules found matching 'Server/Service/Engine/Host/Context/ResourcePara
ms/parameter'.
请高人指点迷津!不胜感激!~
6 个解决方案
#1
难道没人遇到过这种情况吗?
这种版本的问题应该很多人都遇到过的啊!
这种版本的问题应该很多人都遇到过的啊!
#2
自己已经解决了,以上是Tomcat5的jndi配置方法,而到Tomcat5.5.xx以后都需要改成以下的配置方法:
<Resource
name="jdbc/net"
type="javax.sql.DataSource"
password="root"
driverClassName="com.mysql.jdbc.Driver"
maxIdle="2"
maxWait="5000"
username="root"
url="jdbc:mysql://localhost:3306/net"
maxActive="4"/>
#3
对啊,自己解决了啊!
#4
哈哈,是啊!搜了一些资料后改过来就好了啊!
#5
哈哈
#6
不错不错,
#1
难道没人遇到过这种情况吗?
这种版本的问题应该很多人都遇到过的啊!
这种版本的问题应该很多人都遇到过的啊!
#2
自己已经解决了,以上是Tomcat5的jndi配置方法,而到Tomcat5.5.xx以后都需要改成以下的配置方法:
<Resource
name="jdbc/net"
type="javax.sql.DataSource"
password="root"
driverClassName="com.mysql.jdbc.Driver"
maxIdle="2"
maxWait="5000"
username="root"
url="jdbc:mysql://localhost:3306/net"
maxActive="4"/>
#3
对啊,自己解决了啊!
#4
哈哈,是啊!搜了一些资料后改过来就好了啊!
#5
哈哈
#6
不错不错,