Tomcat 启动 (web.xml) 问题

2022-09-02 23:41:15

我正在使用Tomcat 6和eclipse Web工具来发布应用程序。当我部署j2ee应用程序时,我通过tomcat日志收到此错误:

Feb 18, 2010 9:50:33 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_17\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;Pñ
Feb 18, 2010 9:50:33 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Feb 18, 2010 9:50:33 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 443 ms
Feb 18, 2010 9:50:33 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Feb 18, 2010 9:50:33 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
Feb 18, 2010 9:50:33 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor aramark-optima.xml
Feb 18, 2010 9:50:33 PM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.IllegalArgumentException: Can't convert argument: null
 at org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:1005)
 at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:523)
 at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
 at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1138)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.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(AbstractSAXParser.java:1205)
 at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
 at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)
 at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
 at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1072)
 at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4377)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
 at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
 at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:516)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Feb 18, 2010 9:50:33 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Parse error in application web.xml file at jndi:/localhost/aramark-optima/WEB-INF/web.xml
java.lang.IllegalArgumentException: Can't convert argument: null
 at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2806)
 at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2832)
 at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1141)
 at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1774)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2930)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
 at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
 at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.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(AbstractSAXParser.java:1205)
 at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
 at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)
 at org.apache.catalina.startup.ContextConfig.applicationWebConfig(ContextConfig.java:365)
 at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1072)
 at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4377)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
 at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
 at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:516)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.IllegalArgumentException: Can't convert argument: null
 at org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:1005)
 at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:523)
 at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
 at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1138)
 ... 38 more
Feb 18, 2010 9:50:33 PM org.apache.catalina.startup.ContextConfig applicationWebConfig
SEVERE: Occurred at line 8 column 19
Feb 18, 2010 9:50:33 PM org.apache.catalina.startup.ContextConfig start
SEVERE: Marking this application unavailable due to previous error(s)
log4j:WARN No appenders could be found for logger (org.objectweb.jotm).
log4j:WARN Please initialize the log4j system properly.
Feb 18, 2010 9:50:34 PM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Feb 18, 2010 9:50:34 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/aramark-optima] startup failed due to previous errors
Feb 18, 2010 9:50:34 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [JotmBatch] but has failed to stop it. This is very likely to create a memory leak.
Feb 18, 2010 9:50:34 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [JotmClock] but has failed to stop it. This is very likely to create a memory leak.

这将我引向web.xml文件 - 显然存在解析问题。但是,在检查网络时.xml我没有看到任何错误。

这是网络.xml:

    <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <javaee:display-name>BlazeDS</javaee:display-name>
  <javaee:description>BlazeDS Application</javaee:description>
  <context-param>
    <javaee:param-name>f2as.library.file</javaee:param-name>
    <javaee:param-value>/WEB-INF/f2as/user_classes/dto_formulas_complib.swc</javaee:param-value>
  </context-param>
  <context-param>
    <javaee:param-name>f2as.library.root</javaee:param-name>
    <javaee:param-value>com.theriabook.controls.superGridClasses.FormulaBase</javaee:param-value>
  </context-param>
  <context-param>
    <javaee:param-name>mxmlc.configuration.file</javaee:param-name>
    <javaee:param-value>/WEB-INF/f2as/mxmlc-flex-config.xml</javaee:param-value>
  </context-param>
  <context-param>
    <javaee:param-name>f2as.configuration.file</javaee:param-name>
    <javaee:param-value>/WEB-INF/f2as/flex-config.xml</javaee:param-value>
  </context-param>
  <context-param>
    <javaee:param-name>f2as.class.path</javaee:param-name>
    <javaee:param-value>/WEB-INF/f2as/jars</javaee:param-value>
  </context-param>
  <context-param>
    <javaee:param-name>flex.class.path</javaee:param-name>
    <javaee:param-value>/WEB-INF/flex/hotfixes,/WEB-INF/flex/jars</javaee:param-value>
  </context-param>
  <listener>
    <javaee:listener-class>flex.messaging.HttpFlexSession</javaee:listener-class>
  </listener>
  <servlet>
    <javaee:display-name>MessageBrokerServlet</javaee:display-name>
    <servlet-name>MessageBrokerServlet</servlet-name>
    <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
    <init-param>
      <javaee:param-name>services.configuration.file</javaee:param-name>
      <javaee:param-value>/WEB-INF/flex/services-config.xml</javaee:param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet>
    <servlet-name>PdfStreamServlet</servlet-name>
    <servlet-class>com.farata.pdf.StreamPdf</servlet-class>
  </servlet>
  <servlet>
    <servlet-name>PageReqServlet</servlet-name>
    <servlet-class>com.farata.pdf.PageRequesterServlet</servlet-class>
  </servlet>
  <servlet>
    <javaee:display-name>fileupload</javaee:display-name>
    <servlet-name>fileupload</servlet-name>
    <servlet-class>com.aramark.upload.FileUploadServlet</servlet-class>
  </servlet>
  <servlet>
    <javaee:display-name>filedownload</javaee:display-name>
    <servlet-name>filedownload</servlet-name>
    <servlet-class>com.aramark.upload.FileDownloadServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>PdfStreamServlet</servlet-name>
    <url-pattern>*.ppdf</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>PageReqServlet</servlet-name>
    <url-pattern>*.print</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>MessageBrokerServlet</servlet-name>
    <url-pattern>/messagebroker/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>fileupload</servlet-name>
    <url-pattern>/fileupload/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>filedownload</servlet-name>
    <url-pattern>/download/*</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>demo3.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
  </welcome-file-list>
  <filter>
    <filter-name>clearbi-compiler-invocation-interceptor</filter-name>
    <filter-class>com.cti.compiler.env.web.CompilerInvocationInterceptor</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>clearbi-compiler-invocation-interceptor</filter-name>
    <servlet-name>MessageBrokerServlet</servlet-name>
  </filter-mapping>
  <mime-mapping>
    <extension>air</extension>
    <mime-type>application/vnd.adobe.air-application-installer-package+zip</mime-type>
  </mime-mapping>
  <servlet>
    <servlet-name>CrystalReportViewerServlet</servlet-name>
    <servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>CrystalReportViewerServlet</servlet-name>
    <url-pattern>/CrystalReportViewerHandler</url-pattern>
  </servlet-mapping>
  <context-param>
    <javaee:param-name>crystal_image_uri</javaee:param-name>
    <javaee:param-value>/crystalreportviewers</javaee:param-value>
  </context-param>
  <context-param>
    <javaee:param-name>crystal_image_use_relative</javaee:param-name>
    <javaee:param-value>webapp</javaee:param-value>
  </context-param>
</web-app>

答案 1
  1. 将首行“<Web-app”更改为以下内容

    <web-app xmlns="http://java.sun.com/xml/ns/javaee">
    
  2. 在整个文件中,删除任何“javaee:”前缀。

我遇到了同样的问题,我想我们都从同一来源复制了网络.xml文件。我不记得来源是什么,直到现在它才为我工作,我不知道发生了什么变化。


答案 2

正如每个人都提到的那样,这是web的问题.xml Web.xml确实会更新,当您在Eclipse IDE中更新“用户库”时,即在下载相应的库jar之后,它会更新web.xml默认情况下。

您需要立即恢复网络.xml否则会出现此错误。


推荐