0

I'm trying to use Payara micro server to host my Java EE application.

Payara micro server is started with following command:

java -jar payara-micro-4.1.1.161.1.jar --deploy app.war

payara-micro-4.1.1.161.1.jar was downloaded from download page. app.war is my Java EE application.

That command starts Payara micro server, and deploys my war file to the server certainly. In the deploying process, however, Payara micro server responds to the http request before the deployment of war file is finished!

  1. At first, I execute the command java -jar payara-micro-4.1.1.161.1.jar --deploy app.war.
  2. Then, I run HTTP request to “http://localhost:8080/app/”. (In this time, deployment of app.war is not finished.)
  3. Actually, Payara micro server returns 404 error page before deployment of app.war is finished.

In that case, I expect to receive the response from app.war after deployment of app.war is finished. Is there any way to make Payara micro wait to respond to the HTTP request for finishing war file deployment?

Nobuoka Yu
  • 11
  • 5

1 Answers1

0

There is no way to do this within Payara Micro. It's not really a practical thing to implement either, since the server can't just hang on every request for a resource that it can't find just in case it hasn't been deployed yet. When a resource is not found, a web server needs to comply with RFC 2616 and return an HTTP 404 which is the correct response for a missing resource, even if it is only temporarily missing (e.g. during deployment).

Mike
  • 4,852
  • 1
  • 29
  • 48