日期:2014-05-17  浏览次数:21292 次

Tomcat启动报 End event threw exception等错误,改如何解决?
我在一个工程的web.xml中加入如下初始化参数,启动Tomcat会报错,我用的Tomcat版本为Tomcat6.0.20
web.xml:(引起错误的代码,因为只有删掉这些代码才不会报错了,仅把其中<init-param>部分删掉也
能解决问题);

XML code
<servlet>
        <servlet-name>CreateDBServlet</servlet-name>
        <servlet-class>org.sunxin.cho4.servlet.CreateDBServlet</servlet-class>
        <init-param>  
            <param-name>driverClass</param-name>
            <param-value>com.mysql.jdbc.Driver</param-value>
        </init-param>
        <init-param>
            <param-name>url</param-name>
            <param-value>jdbc:mysql://localhost:3306</param-value>
        </init-param>
        <init-param>
            <param-name>user</param-name>
            <param-value>root</param-value>
        </init-param>
        <init-param>
            <param-name>password</param-name>
            <param-value>123</param-value>
        </init-param>
    
    </servlet>
    <servlet-mapping>
        <servlet-name>CreateDBServlet</servlet-name>
        <servlet-pattern>/CreateDB</servlet-pattern>
    </servlet-mapping>


Tomcat报的错误:
第一个错误;
2010-1-23 20:14:03 org.apache.tomcat.util.digester.Digester endElement
严重: End event threw exception
java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.apache.tomcat.util.IntrospectionUtils.callMethodN(IntrospectionUt
ils.java:956)
  at org.apache.catalina.startup.CallMethodMultiRule.end(WebRuleSet.java:7
75)
  at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
  at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:114
0)
  at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endEleme
nt(AbstractSAXParser.java:601)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(X
MLDocumentScannerImpl.java:648)
  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp
l.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:807)
  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(X
ML11Configuration.java:737)
  at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.
java:107)
  at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Ab
stractSAXParser.java:1205)
  at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.p
arse(SAXParserImpl.java:522)
  at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
  at org.apache.catalina.startup.ContextConfig.applicationWebConfig(Contex
tConfig.java:365)
  at org.apache.catalina.startu