javaamazon-web-servicesjerseygrizzly

How to deploy Jersey+Grizzly jar to AWS


I was wondering how can you deploy a Jar file that contains a self-contained app (grizzly) with Jersey framework to AWS Elestic Bean, I've been trying to deploying it by choosing the genereated jar file. But Beanstalk always throws an error. I haven't been able to make it work on AWS. I'm compiling the example that comes with the artifact jersey-quickstart-grlizzly. Any guide of how to do it will be more than welcome!

What i've done so far

  1. Create an instance of AWS Beanstalk.
  2. Set as platform JAVA.
  3. Choose as source a JAR generated by maven build
  4. Deploy.

Once it finishes, it says that the health has been changed to Degraded. That's all.

Update:

Looking for the error 502 I found a suggestion that says that I should run it by command prompt and see what happens. I have forgotten to add the main class attribute in POM. However, it's still showing the same message.

Perhaps, do you have any example of a working example with grizzly that I can deploy to AWS and use for getting started?


Solution

  • After some research I finaly found that the problem was the Port. Perhaps, someone else face this issue because the lack of experience with Java an those frameworks which is my case.

    Build your jar as usual an then:

    1. Go to beanstalk.
    2. In the beanstalk intance where select the environment.
    3. Click on the configuration section and edit "Software"
    4. Add a property called SERVER_PORT with value 5000*.

      • This will redirect to the right port.