skip to Main Content

I’m currently upgrading an application from Spring Boot 2.7.7 to Spring Boot 3.0.2 and hit a 404 at the tomcat.

The interesting thing is that the application works fine on my local machine, but not in the Azure Cloud.
I have the log-level set to DEBUG for org.springframework.web and with Spring Boot 2.7.7 I see the call received in the logs (on Azure) for actuator/info, whereas in Spring Boot 3 I see the application starting successfully but then no further logs.
Any ideas what it could be or what I can try out to debug further?

2

Answers


  1. Chosen as BEST ANSWER

    The problem is related to a change in Tomcat version in Spring 2.7.8 (and therefore also Spring Boot 3.x) in relation to the Java-Agent used in Docker / within Azure.

    Update to the latest java-agent version in the Docker-Image:

    DockerFile

    FROM eclipse-temurin:17
    
    COPY "myBuiltApplication.jar" "app.jar"
    ADD "https://github.com/microsoft/ApplicationInsights-Java/releases/download/**3.4.8**/applicationinsights-agent-*3.4.8*.jar" "agent.jar"
    
    EXPOSE 80
    ENTRYPOINT [ "java", "-javaagent:agent.jar", "-jar", "app.jar"]
    

    Make sure that no other agent is active from Azure

    I had to remove the JAVA_TOOL_OPTIONS and StartupBootstrapper from the docker run:

    - docker run -d --expose=80 --name myapp
      JAVA_TOOL_OPTIONS=-javaagent:/agents/java/applicationinsights-agent-codeless.jar -e StartupBootstrapper=Microsoft.ApplicationInsights.StartupBootstrapper -e 
    

  2. I experienced the same issue with Spring Boot version 2.7.8 with the exact same behavior: Starting the app local in IDE as well as starting the docker image locally worked perfect. When running this image in Azure as an App Service no http call is going to spring. For me it looks like Tomcat has an issue as the 404 seems to be produced by Tomcat.
    Downgrading to Spring Boot 2.7.7 fixed the issue again.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search