我正在使用嵌入式 tomcat(v_ 8.0.33 ) 来运行我的 java 应用程序。它在控制台中引发以下错误:
INFO: Starting Servlet Engine: Apache Tomcat/8.0.33
Jun 11, 2016 2:53:02 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app/servlet/servlet-name'.
Jun 11, 2016 2:53:02 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app/servlet/servlet-class'.
Jun 11, 2016 2:53:02 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app/servlet/init-param/param-name'.
Jun 11, 2016 2:53:02 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app/servlet/init-param/param-value'.
Jun 11, 2016 2:53:02 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app/servlet/init-param'.
Jun 11, 2016 2:53:02 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app/servlet/init-param/param-name'.
Jun 11, 2016 2:53:02 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app/servlet/init-param/param-value'.
Jun 11, 2016 2:53:02 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app/servlet/init-param'.
Jun 11, 2016 2:53:02 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app/servlet/load-on-startup'.
g.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app/servlet-mapping'.
Jun 11, 2016 2:53:02 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'web-app'.
Jun 11, 2016 2:53:02 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
Jun 11, 2016 2:53:04 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Jun 11, 2016 2:53:06 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
我认为它映射到正确的 web.xml 文件,但不知何故无法解析它的标签,不知道为什么。是因为这个 tomcat 的版本(某些东西可能已被弃用并且我正在使用)吗?
下面是我的 web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- This web.xml file is not required when using Servlet 3.0 container,
see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html -->
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<servlet>
<servlet-name>REST Servlet</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>ResourceLoader</param-value>
</init-param>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>sran.api.ifscLookup.resources</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>REST Servlet</servlet-name>
<url-pattern>/Api/*</url-pattern>
</servlet-mapping>
</web-app>