2011-11-17 132 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