Search code examples
javaspringdockerdocker-composepayara

HTTP Status 404 - Not Found in pages when deploying war of Spring application in dockerized payara


I am trying to deploy a spring web application (*.war packaging) in a payara docker container. When I run the app localy in payara, the url http://localhost/my_application/test works fine but when I deploy my app on dockerized payara I get HTTP Status 404 - Not Found. In payara administration panel I can see that the app has been deployed and when I run asadmin list-applications in cli I can see that the app has benn deployed. I cannot find any logical explaination why this could happen. My Dockerfile is

FROM payara/server-full:5.2022.2-jdk11
USER root
ENV http_proxy ${my_hhtp_proxy}
ENV https_proxy ${my_https_proxy}
RUN apt update
RUN apt install -y openjdk-17-jdk
RUN update-java-alternatives -s /usr/lib/jvm/java-1.17.0-openjdk-amd64
COPY .docker/payara/lib $PAYARA_DIR/glassfish/domains/domain1/lib

and my docker-compose.yml is

version: "3.8"
services:
  springApp:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: springApp
    volumes:
      - "./target:/opt/payara/deployments"
    ports:
      - "4848:4848"
      - "8080:8080"
      - "8181:8181"

Updated I can see in the administration panel that when I run the application on docker dispatcherServlet and messageDispatcherServlet are not loaded but when I run the app locally the servlets are loaded. Here is a screenshot of the admin panel. on the left is the local and on the right is the docker administration panel enter image description here


Solution

  • There is nothing wrong with your files. It is a confirmed bug. Payara's team is working to determine the root causes and provide a solution. You may stay up to date (or participate) by following the relevant thread of their GitHub repository.