简体   繁体   中英

Deploying of a war on tomcat 5 complains that file is a directory

I have Tomcat 5 installed on Linux, and have a webapp deployed and happily running for a number of years. I'm now trying to deploy a new webapp, this war is created using Maven and looks fine to me, however there is an error in catalna log preventing it from deploying properly.

It complains:

 java.io.IOException: java.io.FileNotFoundException: 
 /home/jthink/jakarta-tomcat-5.0.27/conf/Catalina/localhost/widget.xml
 (Is a directory)

which is true, widget.xml is a directory. But I didn't create this file and I have no idea where it came from

my war contains the following file structure:

.:
META-INF
WEB-INF

./META-INF:
context.xml
MANIFEST.MF
maven

./WEB-INF:
classes
lib
web.xml

i dont see anything wierd with it

Here is the full stack trace

java.io.IOException: java.io.FileNotFoundException: /home/jthink/jakarta-tomcat-5.0.27/conf/Catalina/localhost/widget.xml (Is a directory)
        at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:494)
        at org.apache.catalina.core.StandardHost.install(StandardHost.java:863)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:482)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1068)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:327)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.StandardHost.backgroundProcess(StandardHost.java:800)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1619)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1628)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1608)
        at java.lang.Thread.run(Thread.java:619)

Workaround

jakarta-tomcat-5.0.27/conf/Catalina/localhost/widget.xml should be a copy of widget.wars META-INF/context.xml file instead of a directory. I have no idea why it is being created as a directory but manually deleting and then copying over context.xml and renaming as widget.xml fixes the problem.

Raised a bug with developers https://issues.apache.org/bugzilla/show_bug.cgi?id=53864 but closed wont-fix because tomcat version is too old. Guess I should upgrade amd see if the problem goes away.

并没有深入探讨这个问题,但是解决方案是升级到Tomcat 7,我还没有意识到Tomcat 5已经过时了。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM