1

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.

Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
  • what's the war file name? do you have any other war file with that name? (`widget.xml`) – asgs Sep 12 '12 at 20:15
  • in 'conf/Catalina/localhost' additional servlet context files are placed. What is the output from 'ls -l /home/jthink/jakarta-tomcat-5.0.27/conf/Catalina/localhost'? – OkieOth Sep 12 '12 at 21:04
  • Well, it did have a an jaikoz.xml file for my jaikoz app, and a widget.xml directory for my widget app but I deleted both as I thought they were put there automatically. This broke my jaikoz application which Ive fixed by manually copying context.xml in my jaikoz.war to localhost and renaming as jaikoz.xml. So should I just manually copy the context.xml file (and it is a file not a dir) from my widget.war into localhost and rename as widget.xml ? META-INF does also contain a maven folder which I didn't ask for, could that be confusing the tomcat deployer. – Paul Taylor Sep 12 '12 at 21:49
  • Maybe I'm not sure in that point. But in your 'conf/Catalina/localhost' should only exist xml files (with application servlet context configuration) named like APP_NAME.xml. If you don't need servlet context configuration leave this directory empty. – OkieOth Sep 13 '12 at 06:37
  • I do need serlvlet context for connecting to db, but deleting widget.xml folder and then manually copying context.xml to localhost, renaming and restarting has fixed the problem. Raised a bug https://issues.apache.org/bugzilla/show_bug.cgi?id=53864 in – Paul Taylor Sep 13 '12 at 09:20

1 Answers1

0

Didn't get to the bottom of this but tHe solution was to upgrade to Tomcat 7, I didn''t realize quite how out of date Tomcat 5 was.

Paul Taylor
  • 13,411
  • 42
  • 184
  • 351