2012-10-31 150 views
2

我不明白我該怎麼做。我試圖在谷歌和這裏搜索,但沒有解決方案解決了我的問題。Tomcat 7.0.32無法部署我的項目

SEVERE: A child container failed during start 
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/strus2starter]] 
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252) 
    at java.util.concurrent.FutureTask.get(FutureTask.java:111) 
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123) 
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800) 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) 
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) 
    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: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/strus2starter]] 
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154) 
    ... 7 more 
Caused by: java.lang.IllegalArgumentException: Filter mapping specifies an unknown filter name struts2 
    at 

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_3_0.xsd" 
    id="WebApp_ID" version="3.0"> 
    <display-name>strubs2Starter</display-name> 
    <welcome-file-list> 
     <welcome-file>index.html</welcome-file> 
     <welcome-file>index.htm</welcome-file> 
     <welcome-file>index.jsp</welcome-file> 
     <welcome-file>default.html</welcome-file> 
     <welcome-file>default.htm</welcome-file> 
     <welcome-file>default.jsp</welcome-file> 
    </welcome-file-list> 



<filter> 
    <filter-name>struts</filter-name> 
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> 
</filter> 

<filter-mapping> 
    <filter-name>struts2</filter-name> 
    <url-pattern>/*</url-pattern> 
</filter-mapping> 
</web-app> 

我運行Mac OS美洲獅64,日食JUNO我上傳所有的罐子從支柱到庫。

+0

你能編輯你的問題併發布web.xml內容嗎? –

+0

是的一刻請 – shaharnakash

+0

你應該看到這個鏈接http://stackoverflow.com/questions/10556201/tomcat-7-0-27-not-starting – aoulhent

回答

1

您的過濾器配置錯誤。這是正確的:

<filter> 
    <filter-name>struts2</filter-name> 
    <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> 
</filter> 

<filter-mapping> 
    <filter-name>struts2</filter-name> 
    <url-pattern>/*</url-pattern> 
</filter-mapping> 

您的篩選器名稱struts而應該是struts2,因爲在<filter>配置您的配置你有一個過濾器命名爲:struts和你正在使用一個名稱struts2映射它<filter-mapping>。此過濾器是未知的,因爲沒有名爲struts2的過濾器。粘貼上面的配置,一切都應該沒問題。

+0

現在感謝它更好 – shaharnakash

+0

不客氣:) –

1

該行稱,根源問題

Caused by: java.lang.IllegalArgumentException: Filter mapping specifies an unknown filter name struts2 

此錯誤在下列情況下發生:

your web.xml file has a <filter-mapping> with no matching <filter>. Each mapping must include a <filter-name> that matches a <filter-name> in a <filter> element. 
your web.xml file has a correctly matched filter-mapping and filter element, but the filter-mapping appears before the filter. The filter-mapping must appear below the filter, because the file is parsed in order. 

只是用Google搜索,發現這個網址。檢查,看看是否是你

http://wiki.metawerx.net/wiki/Java.lang.IllegalArgumentException 


As per you web xml following is the correct one 

<filter> 
    <filter-name>struts2</filter-name> 
     <filter- class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> 

+0

即時檢查thax – shaharnakash

0

給我所知,你的一些瓶子都是從struts1中有的來自Struts2的,所以請確保您將所有罐子無論是從struts1中有用或struts2