unit icon indicating copy to clipboard operation
unit copied to clipboard

Unit not starting WAR File

Open wasson5e opened this issue 1 year ago • 2 comments

System information:

  • Ubuntu 22.04.4 Jammy (Docker Container)
  • Unit 1.32.1 - Installed using Unit Repo

Packages:

unit-dev/stable,now 1.32.1-1~jammy amd64 [installed]
unit-jsc-common/stable,now 1.32.1-1~jammy all [installed,automatic]
unit-jsc18/stable,now 1.32.1-1~jammy amd64 [installed]
unit/stable,now 1.32.1-1~jammy amd64 [installed]

Unit Configuration:

{
    "listeners": {
        "*:80": {
            "pass": "routes"
        }
    },
    "routes": [
        {
            "match":{
                "uri": "/ads/"
            },
            "action": {
                "rewrite": "$uri",
                "pass": "applications/ads"
            }
        },
        {
            "action": {
                "pass": "applications/ads"
            }
        }
    ],
    "applications": {
        "ads": {
            "type": "java",
            "options": [
                "-Dspring.profiles.active=uat",
                "-Dnginx.unit.context.path=/ads"
            ],
            "webapp": "controllers-102.0.4-20240603.143505-1.war",
            "working_directory": "/stage/"
        }
    }
}

This configuration has been working for a while, but I recently needed to rebuild the container as Ubuntu 22.04 is showing vulnerabilities. But even now, Im not getting Unit to load up the java file. When running debug, the only thing of note that I see is: 2024/06/06 19:25:44.435 [debug] 0#773 [unit] Context.wsSession.test: Endpoint instance registration failed

unit.log Debug log is attached. Not sure what is going on. I know that the java file is working as I can load it manually with the java options in the config file.

wasson5e avatar Jun 06 '24 19:06 wasson5e

Update: its something with Spring. I used an older war file and that automatically started up.

Working Spring version: Spring-Boot-Version: 2.7.11 Not working: Spring-Boot-Version: 3.1.4

wasson5e avatar Jun 10 '24 19:06 wasson5e

There is a known issue with Spring Boot ≥3.0 (https://github.com/nginx/unit/issues/869)

lcrilly avatar Jun 11 '24 08:06 lcrilly