日期:2014-05-16  浏览次数:20988 次

tomcat7启动报错,项目在即,恳求大家帮帮忙
在D:\apache-tomcat-7.0.2\conf\Context.xml中配置了连接池 如下:
<Resource name="jndi/raker" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" testWhileIdle="true" testOnBorrow="true" testOnReturn="false" validationQuery="SELECT 1" validationInterval="30000" timeBetweenEvictionRunsMillis="30000" maxActive="100" minIdle="10" maxWait="10000" initialSize="10" removeAbandonedTimeout="60" removeAbandoned="true" logAbandoned="true" minEvictableIdleTimeMillis="30000" jmxEnabled="true" jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState;org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer" username="pay" password="pay" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://192.169.1.201:3306/raker?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull" />

当启动tomcat7是就报错
严重: Parse Fatal Error at line 34 column 751: 对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾。

org.xml.sax.SAXParseException; systemId: file:/D:/apache-tomcat-7.0.2/conf/context.xml; lineNumber: 34; columnNumber: 751; 对实体 "characterEncoding" 的引用必须以 ';' 分隔符结尾。
控制台还有报有这样的一个错误

因此无法启动应用tomcat,没法开工啊,项目即将上线,大家都知道这段时间是最艰难的,希望大家帮助我渡过难关!不甚感激!!


------解决方案--------------------
url="jdbc:mysql://192.169.1.201:3306/raker?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull"

xml中&必须写成&amp;

url="jdbc:mysql://192.169.1.201:3306/raker?useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull"