Jetty 12 docker war not booting

125 Views Asked by At

I am facing issue and the war is not starting (currently migrating from JDK8 to JDK17), the app is migrated to spring boot 3 (jakarta 5.0.0) and its working locally but not working with docker

docker file -

FROM jetty:12.0.3-eclipse-temurin
ADD ./target/ROOT.war ./webapps/
EXPOSE 8080
CMD ["java", "-jar", "/usr/local/jetty/start.jar"]
#RUN java -jar "$JETTY_HOME/start.jar"

``` plain
Container Logs - 
`/opt/java/openjdk/bin/java -Djava.io.tmpdir=/tmp/jetty -Djetty.home=/usr/local/jetty -Djetty.base=/var/lib/jetty -Djava.io.tmpdir=/tmp/jetty --class-path /var/lib/jetty/resources:/usr/local/jetty/lib/logging/slf4j-api-2.0.9.jar:/usr/local/jetty/lib/logging/jetty-slf4j-impl-12.0.3.jar:/usr/local/jetty/lib/jetty-http-12.0.3.jar:/usr/local/jetty/lib/jetty-server-12.0.3.jar:/usr/local/jetty/lib/jetty-xml-12.0.3.jar:/usr/local/jetty/lib/jetty-util-12.0.3.jar:/usr/local/jetty/lib/jetty-io-12.0.3.jar org.eclipse.jetty.xml.XmlConfiguration java.io.tmpdir=/tmp/jetty java.version=17.0.9 jetty.base=/var/lib/jetty jetty.base.uri=file:///var/lib/jetty jetty.home=/usr/local/jetty jetty.home.uri=file:///usr/local/jetty jetty.webapp.addServerClasses=org.eclipse.jetty.logging.,file:///usr/local/jetty/lib/logging/,org.slf4j. runtime.feature.alpn=true slf4j.version=2.0.9 /usr/local/jetty/etc/jetty-bytebufferpool.xml /usr/local/jetty/etc/jetty-threadpool.xml /usr/local/jetty/etc/jetty.xml /usr/local/jetty/etc/jetty-http.xml
2023-11-22T05:44:47.016148390Z 2023-11-22 05:44:47.004:INFO :oejs.Server:main: jetty-12.0.3; built: 2023-10-27T03:25:22.284Z; git: a873259fd5af141dedaa6c7fa8fe8fbdedce0d61; jvm 17.0.9+9
2023-11-22T05:44:47.087147459Z 2023-11-22 05:44:47.082:INFO :oejs.AbstractConnector:main: Started ServerConnector@48524010{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2023-11-22T05:44:47.107870161Z 2023-11-22 05:44:47.106:INFO :oejs.Server:main: Started oejs.Server@1176dcec{STARTING}[12.0.3,sto=5000] @895ms

terminal to container

jetty@6fb96dabf01c:~$ pwd
/var/lib/jetty
jetty@6fb96dabf01c:~$ ls -lrt
total 20
drwxr-xr-x 2 jetty jetty 4096 Nov  2 00:05 start.d
drwxr-xr-x 2 jetty jetty 4096 Nov  2 00:05 resources
drwxr-xr-x 3 jetty jetty 4096 Nov  2 00:05 lib
drwxr-xr-x 2 root  root  4096 Nov 22 05:34 webapps
-rw-r--r-- 1 jetty jetty  969 Nov 22 05:44 jetty.start
jetty@6fb96dabf01c:~$ ls webapps
ROOT.war
jetty@6fb96dabf01c:~$ 

I tried multiple version of jetty but getting the same issue.

I am expecting the java/spring boot based jar will boot strap and show message like

C:\Users\test\.jdks\corretto-17.0.9\bin\java.exe 
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v3.1.5)

logs
00:53:11.505 [main] INFO  o.e.j.server.handler.ContextHandler.application - Initializing Spring DispatcherServlet 'dispatcherServlet'
00:53:11.505 [main] INFO  org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
00:53:11.507 [main] INFO  org.springframework.web.servlet.DispatcherServlet - Completed initialization in 2 ms
00:53:11.543 [main] INFO  org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@681de87f{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
00:53:11.545 [main] INFO  o.s.boot.web.embedded.jetty.JettyWebServer - Jetty started on port(s) 8080 (http/1.1) with context path '/'
00:53:11.573 [main] INFO o.s.t.p.TestApplication - Started TestApplication in 9.991 seconds (process running for 10.917)`your text
0

There are 0 best solutions below