Issue: Spring Boot Application Closes on Mac After Packaging with jpackage, Remains Running in Background
Description:
I created a "Hello World" Spring Boot application and packaged it using jpackage. When running the packaged application on Mac, the application window bounces several times in the dock and then closes, but the app continues to run in the background on port 8080. On Ubuntu, the application stays open as expected. However, another application packaged with jpackage on Mac stays open like it's supposed to.
Steps to Reproduce:
1. I created a simple Spring Boot application https://github.com/tdiprima/hello-spring-boot
2. Build the jar with mvn clean package
3. Package the application with mvn jpackage:jpackage@mac or simply using jpackage.
4. Run the packaged application on Mac.
5. Observe that the application closes while still running in the background on port 8080.
Expected Behavior: The packaged application should remain open and visible, just as it does on Ubuntu.
Actual Behavior: The application closes but continues to run in the background on port 8080.
Environment: - Spring Boot Version: 3.2.5 - Java Version: OpenJDK 21.0.2 - Mac OS Version: macOS 14.1 - jpackage Version: 21.0.2
Additional Information:
- The issue does not occur with a non-Spring Boot application packaged using jpackage on Mac.
- I've tried adjusting various settings and permissions but could not resolve the problem.
Please let me know if any additional information is required or if I can assist with debugging the issue further.
Comment From: philwebb
I'm unable to replicate the issue with the sample provided on macOS 14.4.1. For me the application icon appears in the dock and I can hit http://localhost:8080. If I force quite the application from the dock icon the service stops.
I think you'll need to attempt to get help from the jpackage community as first step. Perhaps there's a way of getting additional logs to see why the app appears to close on your machine. I suspect the Spring Boot logs won't be much use since it appears that the application doesn't actually stop running.