Quickstart for debugging Java Tomcat + AWS Elastic Beanstalk
A sample application for debugging Java Tomcat + AWS Elastic Beanstalk using Rookout.
Before following this guide we recommend reading the basic Java + Rookout guide.
This sample application is the Tomcat sample app provided by AWS. For more information about the project structure and how to use it refer to this page.
Adding Rookout to an existing EBS Project
To integrate Rookout into your existing java beanstalk application follow these steps:
Add the source files to your built .jar/.war
Add these .ebextensions standalone config scripts to your project configuration(.ebextensions)
- Sets up the Rookout ETL Controller, responsible for communicating with the Rookout service. The process is described here : Rookout Integration Process
Deploying on AWS Elastic Beanstalk
You can use either the AWS Management Console or the EB CLI to launch the compiled WAR. Scroll down for EB CLI instructions.
To deploy with the AWS Management Console
Open the Elastic Beanstalk Management Console.
Upload the source (ROOT.war) bundle when creating a new Beanstalk app.
Choose 'Tomcat' Platform.
Make sure everything worked by accessing the url provided by Elastic Beanstalk after build completed.
Change the "name" query parameter to see changes - /?name=rookout, /?name=John
Go to http://app.rookout.com and start debugging!
Rookout Integration Process
We have added Rookout to the original project by:
- Adding Rookout's Elastic Beanstalk .ebextensions to install Rook:
files: "/opt/elasticbeanstalk/lib/rook.jar" : mode: "000444" owner: root group: root source: "http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.rookout&a=rook&v=LATEST"
- Adding Rookout's token to elastic beanstalk environment variables and add the Java Agent to communicate with the app:
- namespace: aws:elasticbeanstalk:container:tomcat:jvmoptions option_name: JVM Options value: '-javaagent:/opt/elasticbeanstalk/lib/rook.jar' - namespace: aws:elasticbeanstalk:container:tomcat:jvmoptions option_name: JVM Options value: '-javaagent:/opt/elasticbeanstalk/lib/rook.jar' - namespace: aws:elasticbeanstalk:application:environment option_name: ROOKOUT_TOKEN value: '<your-token>'