Hi everyone, I am using Grails 6.2.1 with Java 17....
# questions
u
Hi everyone, I am using Grails 6.2.1 with Java 17. After building the WAR file, I deployed it on a Tomcat 11 server running in a Java 17 environment. However, the WAR file is not running as expected on Tomcat. Interestingly, if I run the WAR file directly from the terminal using the following command, it works fine:
java -Dgrails.env=production -Xms512m -Xmx2048m -XX:+UseG1GC -XX:ParallelGCThreads=4 -jar icccplatform.war
Could anyone help me identify what I might be missing? Thank you!
j
Grails 6.2.1 is on Spring Boot 2.7.18 which supports a max tomcat version of 9.0.x. https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/2.7.18 Grails 7 looks like it will be on Spring Boot 3.4.x which supports Tomcat 10.1.x. https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/3.4.0 Grails 8 will likely be the first version to support Tomcat 11.
Doing to war deployment using the embedded version of Tomcat, like your terminal example, is that way I have deployed for years. Much simpler than having to worry with a standalone tomcat install and config.
j
I will say from our experience: container based deployments with a self executing jar with embedded undertow was significantly faster on earlier versions of grails than tomcat. We were stunned at the responsiveness of the application under a container compared to a traditional linux machine deployment.
🚀 2
🏎️ 1
g
@jdaugherty did you ever try it out with Jetty? I personally prefer Jetty over tomcat.
j
I remember us discussing it but for our usages undertow was preferred
j
I posted this in the wrong thread earlier and it includes Jetty. That appears to hold true, although Java 21 narrows the difference between Undertow and Tomcat: https://medium.com/emlakjet/java-17-21-embedded-server-comparisons-696fa1d55e5e - wish this had server versions I've stuck with Tomcat, since it is default and it has served me well for ~23 years, but other options have often offered higher performance.
g
This is a very helpful post. Thanks. btw, grails makes it very cheap to switch between these three app engine. Can sprint boot do the same?
j
We're just changing the starter, so yeah
I checked our internal commit history and the major reason we initially chose undertow was for it's startup performance.
Looks like we did it as of Grails 4 - since we were suffering from an extremely slow startup and were looking for solutions
👍 1
👍🏼 1
u
Thank you for all your responses. As informed by @James Fredley, I have tried running the war file in Tomcat 9 with configured Java 17, but I still haven't had any luck. Am I missing something? I am getting the message below, but the application is not running, and there is no log as well. INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [myapp.war] has finished in [9,752] ms.
j
u
Thank you all for your responses. And thanks to @James Fredley, it worked!
🚀 1