Problems with publishing API from war file
Hello everyone. Recently i started to play arround with SoapUI and later also with ReadyAPI. I quickly set up sonarqube server and was able to create Virtual Service based on some few requests. I disabled the sonarqube and tried to use the service alone - it worked as expected.
Then i exported this service as WAR file.
And tried to publish it with tomcat docker server. But i keep getting this error and when i go to browser i get 404
version: '3.9'
services:
tomcat:
image: tomcat:8
container_name: tomcat
volumes:
- "/mnt/c/PROJECTS/TMNA/soapui-war/war:/usr/local/tomcat/webapps"
ports:
- "8888:8080"
$ docker logs tomcat
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
06-Oct-2023 09:03:34.951 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/8.5.93
06-Oct-2023 09:03:34.953 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Aug 23 2023 22:43:14 UTC
06-Oct-2023 09:03:34.953 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 8.5.93.0
06-Oct-2023 09:03:34.953 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
06-Oct-2023 09:03:34.953 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 5.10.102.1-microsoft-standard-WSL2
06-Oct-2023 09:03:34.953 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /opt/java/openjdk
06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 17.0.8.1+1
06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Eclipse Adoptium
06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat
06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat
06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
06-Oct-2023 09:03:34.954 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
06-Oct-2023 09:03:34.955 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.38] using APR version [1.7.0].
06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [{4}].
06-Oct-2023 09:03:34.956 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
06-Oct-2023 09:03:34.959 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.2 15 Mar 2022]
06-Oct-2023 09:03:34.986 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
06-Oct-2023 09:03:35.007 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 335 ms
06-Oct-2023 09:03:35.029 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
06-Oct-2023 09:03:35.029 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/8.5.93]
06-Oct-2023 09:03:35.047 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/soap.war]
06-Oct-2023 09:03:35.064 INFO [localhost-startStop-1] org.apache.catalina.startup.ExpandWar.expand An expanded directory [/usr/local/tomcat/webapps/soap] was found with a last modified time that did not match the associated WAR. It will be deleted.
06-Oct-2023 09:04:21.937 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@59c08549]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:130)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:161)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:696)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4554)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4692)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:710)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:687)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:661)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1016)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.IllegalArgumentException: java.io.IOException: java.lang.reflect.InvocationTargetException
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:127)
... 16 more
Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException
at org.apache.tomcat.util.compat.Jre9Compat.jarFileNewInstance(Jre9Compat.java:209)
at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:241)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:137)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.apache.tomcat.util.compat.Jre9Compat.jarFileNewInstance(Jre9Compat.java:206)
... 19 more
Caused by: java.util.zip.ZipException: zip END header not found
at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1633)
at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1641)
at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1479)
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1441)
at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:718)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:252)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:181)
at java.base/java.util.jar.JarFile.<init>(JarFile.java:346)
... 24 more
06-Oct-2023 09:04:21.938 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/usr/local/tomcat/webapps/soap.war]
java.lang.IllegalStateException: Error starting child
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:714)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:687)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:661)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1016)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1903)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.apache.catalina.LifecycleException: Failed to initialize component [org.apache.catalina.webresources.JarResourceSet@59c08549]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:419)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:130)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:161)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:696)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4554)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4692)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:171)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:710)
... 9 more
Caused by: java.lang.IllegalArgumentException: java.io.IOException: java.lang.reflect.InvocationTargetException
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:140)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:127)
... 16 more
Caused by: java.io.IOException: java.lang.reflect.InvocationTargetException
at org.apache.tomcat.util.compat.Jre9Compat.jarFileNewInstance(Jre9Compat.java:209)
at org.apache.tomcat.util.compat.JreCompat.jarFileNewInstance(JreCompat.java:241)
at org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.initInternal(AbstractSingleArchiveResourceSet.java:137)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.apache.tomcat.util.compat.Jre9Compat.jarFileNewInstance(Jre9Compat.java:206)
... 19 more
Caused by: java.util.zip.ZipException: zip END header not found
at java.base/java.util.zip.ZipFile$Source.findEND(ZipFile.java:1633)
at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1641)
at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1479)
at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1441)
at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:718)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:252)
at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:181)
at java.base/java.util.jar.JarFile.<init>(JarFile.java:346)
... 24 more
06-Oct-2023 09:04:21.941 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/soap.war] has finished in [46,894] ms
06-Oct-2023 09:04:21.944 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
06-Oct-2023 09:04:21.951 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 46943 ms
I tried with latest, 9 and 8 versions of tomcat
I also exported UI to SoapUI. Again - it worked inside the application but .war file did not work.
BTW: Your documentation lacks some basic information. Like i was really confused that i could not find any option related to "Discover API" in SoapUI. For example please take a look on gitlab's documentation - each topic has tags indicating which version (free, paid, cloud etc) particular section is applicable to.