Closed dgrecoBill1st closed 3 months ago
Hi @dgrecoBill1st what's the version of Spring and Tomcat you have tested this with?
Our Java implementation is limited to the Servlet API version 3.1 which is spring 2.
Spring Boot 2.7.18
Tomcat 9.0.83
Any ideas on this? Really would like to utilize unit for this small project requiring java, as our primary infrastructure is PHP on Unit already.
Good evening @dgrecoBill1st sorry for the long response time.
Can you share a WAR file for diagnosis or share a simple example on how to reproduce this?
Sure, attaching the war here (renamed to add .zip as cannot upload war) crypt-0.0.1.war.zip crypt-0.0.1.war.zip . Here is the full setup and steps:
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bill1st</groupId>
<artifactId>crypt</artifactId>
<version>0.0.1</version>
<properties>
<start-class>com.bill1st.CryptApplication</start-class>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.18</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<packaging>war</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Built with maven 3.5.4
Application is simple hello world controller mapped to / URI
Configured Unit:
http://localhost/config/listeners/127.0.0.1:8312
{
"pass": "routes/crypt"
}
http://localhost/config/routes/crypt
[
{
"match": {
"uri": "*"
},
"action": {
"pass": "applications/crypt"
}
}
]
http://localhost/config/applications/crypt
{
"type": "java",
"webapp": "/var/www/crypt/crypt-0.0.1.war",
"working_directory": "/var/www/crypt/",
"environment": {
<REDACTED>
}
}
And the result: curl http://127.0.0.1:8312
<a href="META-INF">META-INF</a><br>
<a href="WEB-INF">WEB-INF</a><br>
Closing ticket, I did a new clean build of the project and it works in unit now.
Having an issue with a WAR spring boot application in unit-jsc11. The same war deploys and runs fine in tomcat. In unit, the result is an unarchive style output:
The application config is:
Unit log shows:
Any tips for diagnosing this? I see a bug mentioned here - https://github.com/nginx/unit/issues/403 though the patch that fixed there is in my version of Unit (1.32.0)