Tomcat creates WEB-INF/lib but doesnt explode war

2019-03-02 16:24发布

问题:

Has anyone seen anything like this:

I'm using a script which basically undeploys an app using ant, puts the new war file in the deploy directory and then deploys it using ant again.

The problem is, after the deploy all that exists in the webapps folder are 3 directories: myapp/WEB-INF/lib

There are no other files in there other than those 3 empty directories. The timestamps of the directories indicate they were created when I ran the script.

After this happens, undeploying through Tomcat manager and then stop/starting Tomcat seems to explode it correctly, but I ideally want to use the script for automation.

Anyone seen a similar issue/know what could be going wrong?

Undeploy/deploy script hasnt changed since prior release so I dont think its that. Main thing thats changed in my actual project other than some code change is upgrading to a new GWT version. New GWT versions put some files in a folder called /WEB-INF/deploy/ but I dont think that'd cause it. Dont really see any errors in the logs

回答1:

War file is nothing but a zip file and it will get deployed once you start/ stop the server. Not sure about ant "Undeploy"

Kirubha



回答2:

  1. Have you tried cleaning the tomcat work and temp directories?
  2. What does the deploy script do? Does it first remove the old war, and then copy the new war, or does it overwrite the war file?
  3. What happens, if you create your war manually (just zip the contents you need), and put it in the webapps directory?
  4. Maybe look at the auto-deploy configuration in your conf/server.xml file: <Host unpackWARs="..." autoDeploy="..."/>


回答3:

FWIW, we experienced something similar on a fresh, simple* WAR deployment on Tomcat 7.

I'm seeing compiled JSP classes appear as I visit the respective page. So the app works, it's just not exploded to the work area... not sure why.

I'm having a hard time explaining what has happened because this was an incremental application upgrade and the initial install required an identical process**, which went very smoothly. This suggests it isn't a tomcat configuration issue.

* We use deployment descriptor (xml) files so we can reuse the same war

** The process was to manually run a script that was packaged in the WEB-INF folder

[Update] I may have just answered my own question. If I'm reusing WAR files for different deployment contexts then perhaps a common exploded WAR is being used ?!