3

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

Ioanna Dln
  • 309
  • 2
  • 13
  • 1
    I added a web.xml in my project, as described in this link https://www.baeldung.com/spring-mvc-404-error and declared dispatcherServlet and messageDispatcherServlet in the file, but although I was redirected to the correct page, it seemed to have other problems such as security issues (spring security did not work correctly). I guess it seems that dockerized payara has issues with spring apps. – Ioanna Dln Jun 01 '22 at 18:24

1 Answers1

3

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.

Andreas Violaris
  • 2,465
  • 5
  • 13
  • 26