We all faced that. You set up the server. Make the call to your rest service and… You get a weird failure. What happened here?
It worked great on my machine, why is it failing in the cloud?
Is it the CDN, is it my code, what’s going on?
I can’t tell you, but Lightrun usually can. Let me show you how…
For the purpose of this tutorial I’ll use the pet clinic demo from here: https://github.com/spring-projects/spring-petclinic
It’s a relatively simple demo which includes rest calls. You can use any code since I won’t rely on anything specific to that demo.
Step 1 – Build the Demo
Open the project directory from the repository in IntelliJ. Run the “Package” option in the maven toolwindow.
Step 2 – Install Lightrun
If you didn’t do this yet go to https://app.lightrun.com and follow the steps to create an account. Download the IDE plugin and set up the agent on your server. I won’t replicate the steps here as they are pretty clear on the website.
You can download the agent into the project directory then run the app using:
java -agentpath:PATH_TO_AGENT_DIRECTORY/lightrun_agent.so -jar target/spring-petclinic-2.4.5.jar
Notice you need to replace PATH_TO_AGENT_DIRECTORY with the right path. Try to avoid shortcuts like ~ which might cause issues.
You can now install the plugin and login via the IDE.