0

Tomcat で戦争を展開しようとしましたが、例外が発生しています

SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/DataProvider]]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:968)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1646)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> com/above/ServletInitializer in servlet mapping
        at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3217)
        at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3192)
        at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1305)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1349)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 11 more

Nov 08, 2012 6:29:24 PM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.32\webapps\DataProvider.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/DataProvider]]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:968)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1646)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java.lang.Thread.run(Thread.java:722)

Nov 08, 2012 6:29:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.32\webapps\docs
Nov 08, 2012 6:29:24 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [139] milliseconds.
Nov 08, 2012 6:29:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.32\webapps\examples
Nov 08, 2012 6:29:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.32\webapps\host-manager
Nov 08, 2012 6:29:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.32\webapps\manager
Nov 08, 2012 6:29:24 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.32\webapps\ROOT
Nov 08, 2012 6:29:25 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8081"]
Nov 08, 2012 6:29:25 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8010"]
Nov 08, 2012 6:29:25 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6130 ms

web.xml の内容は

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>EaasWebApp</display-name>
  <servlet>
    <servlet-name> REST Service</servlet-name>
    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    <init-param>
      <param-name>com.sun.jersey.config.property.packages</param-name>
      <param-value>com.above</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>REST Service</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
  <filter>
    <filter-name>CORS</filter-name>
    <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>CORS</filter-name>
    <url-pattern>/services/*</url-pattern>
  </filter-mapping>
  <servlet>
    <servlet-name>ServletInitializer</servlet-name>
    <servlet-class>com.above.ServletInitializer</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
</web-app>

で無効な url-pattern 例外が発生しています

 <servlet>
    <servlet-name>ServletInitializer</servlet-name>
    <servlet-class>com.above.ServletInitializer</servlet-class>
    <load-on-startup>0</load-on-startup>
 </servlet>

間違いは何ですか?

4

1 に答える 1

1

間違いは、サーブレット名の最初の宣言の先頭にスペースがあることです:

 <servlet-name> REST Service</servlet-name>

の 2 番目の宣言はそうで<servlet-mapping>はありません

于 2012-11-13T21:38:16.673 に答える