Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

We are deploying a java web application in Elastic Beanstalk. The Beanstalk by default provides Redhat instances with Tomcat7 & OpenJDK. But I want to customize the instances so that I can use Sunjdk. I launched a new instance from EC2 & installed sun JDK, tomcat7 and created a custom AMI of the instance and provided its ID in Custom AMI id field in edit Environment configuration in BeanStalk. But my Environment Health status is changing to RED, and the application is not deployed. Can you please suggest me a solution for this.

1 Answer

0 votes
by (44.4k points)

I have done exactly what you want to do, and am happy to report that it works. In my first attempts, I encountered the same issue. Make sure that you:

  • Create your custom AMI from a running instance of Amazon's beanstalk AMI that you manually launch from EC2, NOT one that was launched from beginning your application through beanstalk. This is vital, as Flashing a beanstalk launched EC2 instance won't work!!
  • install Sun's Java as per these instructions, to make sure all the environment and symbolic links are correct. https://forums.aws.amazon.com/message.jspa?messageID=251168#251168
  • be patient, as I found for some reason Tomcat takes longer to spin up than with the default OpenJDK config.

If you still can't get it, make sure you check the logs in /opt/tomcat7/logs/catalina.out - I hit a mysterious VerifyException that was resolved by uploading a new .jar to the environment, and that I also ran out of permgen space quickly, which was resolved by upping the values in the 'Container' configuration space of the beanstalk 'edit configuration'.

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...