Deployment problem

I have a small application that has 2 additional databases to pull 2 tables data and using API to send SMS, built (war) on the latest version on Jmix.

It works well when I am running it in development environment but deployment is failed (on Tomcat 10). Note that i have some other jmix application running in the same server though.

Here is the exception:

15-May-2024 08:53:54.916 SEVERE [Catalina-utility-1] org.apache.catalina.startup.ContextConfig.beforeStart Exception fixing docBase for context [/inteaccsms]
	java.util.zip.ZipException: zip END header not found
		at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1469)
		at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1477)
		at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1315)
		at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1277)
		at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:709)
		at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:243)
		at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:172)
		at java.base/java.util.jar.JarFile.<init>(JarFile.java:347)
		at java.base/sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:103)
		at java.base/sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:72)
		at java.base/sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:168)
		at java.base/sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:131)
		at java.base/sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:92)
		at org.apache.catalina.startup.ExpandWar.expand(ExpandWar.java:129)
		at org.apache.catalina.startup.ContextConfig.fixDocBase(ContextConfig.java:821)
		at org.apache.catalina.startup.ContextConfig.beforeStart(ContextConfig.java:960)
		at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:306)
		at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
		at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:182)
		at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683)
		at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
		at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:713)
		at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:975)
		at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1949)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
		at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
		at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:776)
		at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
		at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1705)
		at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:305)
		at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
		at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1098)
		at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1297)
		at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1301)
		at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1279)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
		at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
		at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
		at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
		at java.base/java.lang.Thread.run(Thread.java:833)
15-May-2024 08:53:54.923 SEVERE [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/opt/tomcat/webapps/inteaccsms.war]
	java.lang.IllegalStateException: Error starting child
		at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:686)
		at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
		at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:713)
		at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:975)
		at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1949)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
		at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
		at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:776)
		at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426)
		at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1705)
		at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:305)
		at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
		at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1098)
		at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1297)
		at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1301)
		at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1279)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
		at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
		at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
		at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
		at java.base/java.lang.Thread.run(Thread.java:833)
	Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.WarResourceSet@1d3e8037]
		at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
		at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:139)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:173)
		at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:715)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
		at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4571)
		at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4704)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
		at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683)
		... 24 more
	Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: zip END header not found
		at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:141)
		at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
		... 31 more
	Caused by: java.util.zip.ZipException: zip END header not found
		at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1469)
		at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1477)
		at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1315)
		at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1277)
		at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:709)
		at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:243)
		at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:172)
		at java.base/java.util.jar.JarFile.<init>(JarFile.java:347)
		at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:138)
		... 32 more
15-May-2024 08:53:54.924 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/tomcat/webapps/inteaccsms.war] has finished in [12] ms
15-May-2024 08:54:04.931 INFO [Catalina-utility-1] org.apache.catalina.startup.HostConfig.undeploy Undeploying context [/inteaccsms]

It says that zip file is somehow damaged/corrupted - war and jar files are just zipped archives. Can you verify the integrity of your war file - maybe you did not upload it completely, or you started tomcat before it got uploaded, or tomcat itself did it prematurely if its configured to autodeploy new war files in webapps directory (not sure if the last one is really possible).

Fixed it, I missed the following in gradle file

plugins {
    // ...
    id 'war'
}
1 Like