tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 45989] New: Deployer fails when copy of large war to webapps/ is slow
Date Fri, 10 Oct 2008 18:59:04 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=45989

           Summary: Deployer fails when copy of large war to webapps/ is
                    slow
           Product: Tomcat 6
           Version: 6.0.18
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: johnha@ccbill.com
                CC: johnha@ccbill.com


The tomcat deployer apparently does not check the integrity of a war before
undeploying the existing application and deploying the new version.

To re-create this, start tomcat and deploy a war by copying, over the network,
a large war directly into the webapps directory.   I get the following output:

INFO: Deploying web application archive some.war
Oct 10, 2008 11:40:05 AM org.apache.catalina.startup.ContextConfig init
SEVERE: Exception fixing docBase: {0}
java.util.zip.ZipException: Could not find End Of Central Directory
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:117)
        at java.util.jar.JarFile.<init>(JarFile.java:133)
        at java.util.jar.JarFile.<init>(JarFile.java:70)
        at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:72)
        at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:48)
        at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:68)
        at
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
        at
sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:71)
        at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:141)
        at
org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:883)
        at
org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:1012)
        at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.StandardContext.init(StandardContext.java:5341)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4086)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:792)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:527)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1338)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
        at java.lang.Thread.run(Thread.java:619)
Oct 10, 2008 11:40:05 AM org.apache.catalina.core.StandardContext
resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Invalid or unreadable WAR file : Could not
find End Of Central Directory
        at
org.apache.naming.resources.WARDirContext.setDocBase(WARDirContext.java:135)
        at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3957)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4126)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
        at java.lang.Thread.run(Thread.java:619)
Oct 10, 2008 11:40:05 AM org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart() 
Oct 10, 2008 11:40:05 AM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Oct 10, 2008 11:40:05 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/some] startup failed due to previous errors
Oct 10, 2008 11:40:05 AM org.apache.catalina.core.StandardContext stop
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/some] has not
been started
Oct 10, 2008 11:40:15 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/some] 
Oct 10, 2008 11:40:15 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive some.war
Oct 10, 2008 11:40:15 AM org.apache.catalina.startup.ContextConfig init
SEVERE: Exception fixing docBase: {0}
java.util.zip.ZipException: Could not find End Of Central Directory
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:117)
        at java.util.jar.JarFile.<init>(JarFile.java:133)
        at java.util.jar.JarFile.<init>(JarFile.java:70)
        at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:72)
        at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:48)
        at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:68)
        at
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
        at
sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:71)
        at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:141)
        at
org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:883)
        at
org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:1012)
        at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.StandardContext.init(StandardContext.java:5341)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4086)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:792)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:527)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1338)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
        at java.lang.Thread.run(Thread.java:619)
Oct 10, 2008 11:40:15 AM org.apache.catalina.core.StandardContext
resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Invalid or unreadable WAR file : Could not
find End Of Central Directory
        at
org.apache.naming.resources.WARDirContext.setDocBase(WARDirContext.java:135)
        at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3957)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4126)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
        at java.lang.Thread.run(Thread.java:619)
Oct 10, 2008 11:40:05 AM org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart() 
Oct 10, 2008 11:40:05 AM org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
Oct 10, 2008 11:40:05 AM org.apache.catalina.core.StandardContext start
SEVERE: Context [/some] startup failed due to previous errors
Oct 10, 2008 11:40:05 AM org.apache.catalina.core.StandardContext stop
INFO: Container
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/some] has not
been started
Oct 10, 2008 11:40:15 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/some] 
Oct 10, 2008 11:40:15 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive some.war
Oct 10, 2008 11:40:15 AM org.apache.catalina.startup.ContextConfig init
SEVERE: Exception fixing docBase: {0}
java.util.zip.ZipException: Could not find End Of Central Directory
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:117)
        at java.util.jar.JarFile.<init>(JarFile.java:133)
        at java.util.jar.JarFile.<init>(JarFile.java:70)
        at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:72)
        at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:48)
        at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:68)
        at
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
        at
sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:71)
        at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:141)
        at
org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:883)
        at
org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:1012)
        at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:279)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.StandardContext.init(StandardContext.java:5341)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4086)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:792)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:527)
        at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
        at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
        at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1217)
        at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1338)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
        at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
        at java.lang.Thread.run(Thread.java:619)
Oct 10, 2008 11:40:15 AM org.apache.catalina.core.StandardContext
resourcesStart
SEVERE: Error starting static Resources

If I copy some.war into a temporary location on the local disk and then copy it
into the webapps/ directory it deploys.  If I try to redeploy the already
deployed webapps by copying it from the network again, I get the following
output:

Oct 10, 2008 11:41:46 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/some]
Oct 10, 2008 11:41:46 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive some.war
Oct 10, 2008 11:41:56 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/some]
Oct 10, 2008 11:41:56 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive some.war
Oct 10, 2008 11:42:06 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/some]
Oct 10, 2008 11:42:06 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive some.war
Oct 10, 2008 11:42:16 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/some]
Oct 10, 2008 11:42:16 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive some.war
Oct 10, 2008 11:42:26 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/some]
Oct 10, 2008 11:42:26 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive some.war
Oct 10, 2008 11:42:36 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/some]
Oct 10, 2008 11:42:36 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive some.war
Oct 10, 2008 11:42:46 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/some]
Oct 10, 2008 11:42:46 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive some.war

The end result is that final deployment of the application is corrupted. 
Classes in jars in the WEB-INF/lib directory are unavailable to the
application, etc.   Is there anyway to get tomcat to check the integrity of new
wars copied into webapps/ and have it not undeploy the existing application, or
deploy the new application if the integrity check fails?  If the deployer
retests the war whenever inotify or whatever strategy tells tomcat the file has
changed, and does not deploy it until the war passes the check, I think that
will solve this problem.

I realize I could just use the management app, or a temporary directory, but
that would break rsync style code release to load balanced clusters, etc.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message