Tomcat启动(web.xml)问题

时间:2010-02-19 02:54:52

标签: java flex tomcat

我正在使用带有eclipse web工具的Tomcat 6来发布应用程序。当我部署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文件 - 显然正在解析问题。但是,在检查web.xml时,我没有看到任何错误。

这是web.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>

4 个答案:

答案 0 :(得分:38)

  1. 将初始行“&lt; web-app”更改为以下

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

  3. 我遇到了同样的问题,我想我们都是从同一个源复制了web.xml文件。我不记得是什么来源,它对我有用,直到现在,我不知道发生了什么变化。

答案 1 :(得分:2)

大家都提到了web.xml的问题 当您在Eclipse IDE中更新“用户库”时,web.xml会更新 即在下载相应的库jar之后,它默认更新web.xml。

您需要立即恢复您的web.xml,否则您将收到此错误。

答案 2 :(得分:1)

这是你的问题:

  

严重:应用程序中的解析错误   web.xml文件在   JNDI:/localhost/aramark-optima/WEB-INF/web.xml

这不是有效的JNDI查找。这拼写在哪里?

答案 3 :(得分:0)

重命名项目时我也遇到了这个错误(eclipse完全改变了web.xml文件)。通过恢复修复它。