2011-11-17 122 views
1

我想在提到的tomcat應用程序服務器上部署WAR。但是,以下是我嘗試使用tomcat管理器/ ant腳本進行部署時遇到的錯誤。Apache Tomcat/6.0.24上的部署錯誤

java.lang.IllegalStateException: ContainerBase.addChild: start: LifecycleException: Error initializaing : java.lang.IllegalArgumentException: The archive [jar:file:/var/lib/tomcat6/webapps/afgretail.war!/] is malformed and will be ignored: an entry contains an illegal path [/] 

的WAR中包含的Spring bean,HTML頁面,JS,圖片,CSS等,我們正在通過直接應對解壓後的項目到工作正常的Tomcat服務器上的webapps目錄正在部署該項目。然而,我們想部署使用開發的war腳本來將war文件部署到遠程tomcat。

的發展是在Windows平臺上完成,但Tomcat服務器駐留在Linux(在Oracle Enterprise Linux)

片段,做部署如下:

<!-- Configure the folder and context path for this application --> 
<property name="webapp" value="walton" /> 
<property name="path" value="/walton" /> 

<!-- Configure properties to access the Manager application --> 
<property name="url" value="http://localhost:8080/manager/html" /> 
<!-- <property name="url" value="http://osm4.afgonline.com.au:8080/manager/html" />--> 
<property name="username" value="tomcat" /> 
<property name="password" value="s3cret" /> 

<property name="dist.dir" value="dist" /> 

<property name="webapp.path" value="${dist.dir}/${webapp}" /> 

<property name="project.path" value="C:/java/workspace/afghl_walton"/> 

<path id="deployer.classpath"> 
    <!--fileset dir="${basedir}/lib"--> 
    <fileset dir="C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib\"> 
     <include name="*.jar" /> 
    </fileset> 
</path> 

<!-- Configure the custom Ant tasks for the Manager application --> 
<taskdef resource="org/apache/catalina/ant/catalina.tasks" 
    classpathref="deployer.classpath" /> 

<target name="deploy" description="Deploy web application"> 
    <deploy url="${url}" username="${username}" password="${password}" 
     path="${path}" war="${project.path}/${webapp.path}.war" update="true" /> 
</target> 

任何幫助將apprrciated。如果需要更多信息,請告訴我。

感謝,

庫什

+0

有Ant腳本錯誤,你可以張貼的目標進行實際dpeloyment該片段。 – shinynewbike

+0

@shinynewbike我已經更新了我的帖子與片段。 – Khush

+0

nope這似乎是JVM錯誤,因爲在你以前的問題 – shinynewbike

回答

1

我有與Tomcat 5.5.34相同的問題。我建立與螞蟻和WAR目標WAR包含以下任務:

前綴造成命名爲「/」在戰爭中包和Tomcat的自5.5.26的JAR條目啓動過程中條目導致異常的Tomcat容器。

更改war命令的前綴屬性值爲 刪除了我所有的問題。

最好的問候, 克里斯

+0

你在說什麼前綴屬性? – Khush

+0

問題已修復。原因是前綴/ WEB-INF/classes。從WEB-INF的前面刪除了「/」。終於在多年後解決了這個問題。 – Khush

0

只要避免使用出來的getOutputStream在同一時間!

+0

你能更具體嗎?你正在考慮在jsp中使用out.print?這個項目中我沒有jsp頁面。 – Khush