Testing Payara 6 with Java 21 maven-build

While deploying a web application, I had an issue loading external files like CSS, JS and pictures.

Deployment is done on Ubuntu 24.10, with jdk-21, and MySQL 8. Compilation and deployment are done without error. The IDE used is Intellij. When you launch the application (Firefox v136.0), the login page is displayed, but the CSS file and pictures are not loaded.

The deployment is done correctly on the root folder: CSS files are in a folder dedicated to CSS, and pictures are in a dedicated folder. WEB-INF contains the classes folder, the lib folder and the web.xml file.

![|399x360](file:///tmp/lu133871ll5t.tmp/lu133871llbv_tmp_8e28537.gif)

In the developer’s console, a message is displayed:

The stylesheet http://ptsag-backup:7171/gs-css/platform.css was not loaded because its MIME type, “text/html”, is not “text/css”.

There is no error message for the picture; when you point to the HTML , a title is displayed: the picture cannot be displayed.

![|385x296](file:///tmp/lu133871ll5t.tmp/lu133871llbv_tmp_e49ddbbc.gif)

Usually, we have such a message when the resource cannot be found, but this is not the case. On tab Network of the developer’s console, we can check that the resource has a status set to 200 and content-type set to text/html;charset=UTF8. The PNG picture has the same status and content type.

So resources are found but loaded with the wrong content type.

On Payara, the content type comes from the file’s extension and the from the “default-web.xml” file located in the “config” directory. I checked that all was in place.

I added in the web.xml file for the application, but it didn’t help.

On Google, I didn’t find any relevant information to fix the issue. And the Payara manual was useless this time!

Maybe I just missed a simple step! Or is there any known issue with Payara 6?

Does anyone know?