hapifhir / hapi-fhir-jpaserver-starter

Apache License 2.0
395 stars 1.05k forks source link

HAPI-FHIR not deploying on tomcat docker image #716

Closed nr23730 closed 3 months ago

nr23730 commented 3 months ago

Starting with 7.0.0 all docker images (docker.io/hapiproject/hapi) with the -tomcat suffix won't start HAPI-FHIR. This is even though tomcat claims that the app will be deployed (see logs below) Version 6.10.1 works correctly.

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-Aug-2024 09:15:13.839 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Server/Service/Connector] failed to set property [maxThreads] to [${server.tomcat.max-threads}]
06-Aug-2024 09:15:13.841 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Server/Service/Connector] failed to set property [minSpareThreads] to [${server.tomcat.min-spare-threads}]
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.86
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Feb 14 2024 08:15:12 UTC
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.86.0
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            6.9.12-401.asahi.fc40.aarch64+16k
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          aarch64
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /opt/bitnami/java
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           17.0.10+13-LTS
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            BellSoft
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/bitnami/tomcat
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/bitnami/tomcat
06-Aug-2024 09:15:13.860 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/bitnami/tomcat/conf/logging.properties
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseG1GC
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dfile.encoding=UTF-8
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.net.preferIPv4Stack=true
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.net.preferIPv4Addresses=true
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Duser.home=/opt/bitnami/tomcat
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
06-Aug-2024 09:15:13.861 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
06-Aug-2024 09:15:13.862 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/bitnami/tomcat
06-Aug-2024 09:15:13.862 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/bitnami/tomcat
06-Aug-2024 09:15:13.862 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/bitnami/tomcat/temp
06-Aug-2024 09:15:13.864 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.3.0] using APR version [1.7.4].
06-Aug-2024 09:15:13.864 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true], UDS [true].
06-Aug-2024 09:15:13.864 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
06-Aug-2024 09:15:13.866 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.11 19 Sep 2023]
06-Aug-2024 09:15:14.045 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
06-Aug-2024 09:15:14.066 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [299] milliseconds
06-Aug-2024 09:15:14.092 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
06-Aug-2024 09:15:14.092 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.86]
06-Aug-2024 09:15:14.103 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/bitnami/tomcat/webapps/ROOT.war]
06-Aug-2024 09:15:14.581 WARNING [main] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [6.0]. Default version will be used.
06-Aug-2024 09:15:14.588 WARNING [main] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [5.0]. Default version will be used.
06-Aug-2024 09:15:14.592 WARNING [main] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [6.0]. Default version will be used.
06-Aug-2024 09:15:18.791 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
06-Aug-2024 09:15:18.808 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/bitnami/tomcat/webapps/ROOT.war] has finished in [4,705] ms
06-Aug-2024 09:15:18.810 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
06-Aug-2024 09:15:18.813 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [4747] milliseconds
dotasek commented 3 months ago

@nr23730 I can replicate with the latest release.

docker pull hapiproject/hapi:latest-tomcat
docker run -p 8080:8080 <generated-image-id>

I was looking into a different issue regarding Tomcat (build related), and recently tested against that build:

https://github.com/hapifhir/hapi-fhir-jpaserver-starter/pull/720

When running off that image, I DO get a working HAPI (I can run all the smoketest files without error).

I built and tested as follows:

Built with `docker build --target tomcat . `
Started the new image in a container with `docker run -p 8080:8080 <generated-image-id>`
Ran the smoke tests against container (https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/test/smoketest/plain_server.http)

If that PR is approved, it will be used in the next release. Comments in the PR would be appreciated.

jkiddo commented 3 months ago

Out of curiosity @nr23730 - how come you use the tomcat variant and not the distroless?

nr23730 commented 3 months ago

It's way more responsive when you just use it every now and then.

dotasek commented 3 months ago

@nr23730 could you try building the tomcat image using this branch: rel_7_3_tracking?

nr23730 commented 3 months ago

Works as expected. Thank you very much!