Search code examples
gradlewelcome-filepayara-micro

index.html not found payara micro


I have a Java application and I am using Payara Micro 4.1.2.174 to deploy it. I am trying to configure the index.html file, which I placed in the folder src/main/webapp. However, no matter what I do, the file is not reachable, I am getting a 404 when trying to access it on the localhost: http://localhost:8080/index.html. I am building the war file using gradle. I also checked the built war file and the index.html file is at the root of the archive.

I am deploying my application at /, all the paths are also available starting from /:

Loading application [ROOT] at [/]

I tried adding following in the glassfish-web.xml file, it didn't help:

<glassfish-web-app error-url="">
    <context-root>/</context-root>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>

</glassfish-web-app>

Is there anything that I am missing? Is it possible to have an index.html in Payara Micro?

Thanks!


Solution

  • I found the problem with my setup: I am using JAX-RS and the class that extends Application was annotated with @ApplicationPath("/") which somehow caused the default behaviour to be overwritten. I changed that annotation and now everything works as expected, with the expected WAR structure.