1

I'm looking for ways to deploy an application in Payara Micro under a specific context root (ideally an empty context, so the application runs at root).

As far as I know there are two methods:

  1. Use an .ear file and specify the context root in the application.xml file:

    <context-root>/</context-root>

  2. Start Payara Micro and deploy programmatically

    PayaraMicroRuntime instance = PayaraMicro.bootstrap(); InputStream is = new FileInputStream("thewar.war") instance.deploy("name", "contextroot", is);

Is there any other way I'm missing? Both versions above are not suitable for me in my current setup.

DᴀʀᴛʜVᴀᴅᴇʀ
  • 7,681
  • 17
  • 73
  • 127
  • What is your current setup? The way to do this with a WAR file is with a `glassfish-web.xml` file, as in this answer: http://stackoverflow.com/a/18358642/212224 – Mike Sep 14 '16 at 08:06
  • Thank you, @Mike, for your comment. It looks like this should work, but payara micro seems to not read the `glassfish-web.xml`. I have it packaged in the war file at `META-INF/glassfish-web.xml` by maven and its only contents are: ` /yoman ` Anyting I'm missing here? Or do you know a way to check if payara micro is even reading the file? – running hedgehog Sep 14 '16 at 13:24
  • All right, the file needs to go to `WEB-INF/glassfish-web.xml` and then it works like a charm. @Mike, do you want to write that into an answer? – running hedgehog Sep 14 '16 at 13:59

0 Answers0