tomcat 版本问题

对于tomcat5.0 配置数据源的时候要求在server.xml中进行修改加上例如:

   <DefaultContext reloadable="true" crossContext="true">
    <Resource name="jdbc/juddiDB" scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/juddiDB">
     <parameter>
      <name>url</name>
      <value>jdbc:mysql://localhost/juddi</value>
     </parameter>
     <parameter>
      <name>driverClassName</name>
      <value>org.gjt.mm.mysql.Driver</value>
     </parameter>
     <parameter>
      <name>username</name>
      <value>root</value>
     </parameter>
     <parameter>
     <!--帐号密码根据数据库安装配置修改-->
     <name>password</name>
      <value>******</value>
     </parameter>
    </ResourceParams>
   </DefaultContext>


这样的代码。

但是对于tomcat6.0.16的版本,配置数据源一般不修改server.xml,而是在context.xml中对数据源进行相应的配置,如:

<Resource name="jdbc/juddiDB" scope="Shareable" type="javax.sql.DataSource"
     maxActive="100" maxIdle="30" maxWait="10000"
     username="root" password="root" driverClassName="com.mysql.jdbc.Driver"
     url="jdbc:mysql://localhost:3306/juddi"/>

不然配置不对,可能会报tomcat版本错误,错误如下:

警告:   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'.

原文地址:http://blog.sina.com.cn/s/blog_62276c5a0100x334.html

你可能感兴趣的:(tomcat)