Need help setting up Thingsboard backend for local debugging
I’m trying to debug some backend features on my computer but I’m running into issues. I’ve gone through the contribution guide and managed to build from source on Ubuntu 20.04. Now I’ve got the project imported into Eclipse as a Maven project.
What steps should I take next to actually debug the backend locally? I’m not sure how to set up the debugger or run it properly in Eclipse. Has anyone done this before who could share some tips?
I’m particularly interested in:
Configuring run/debug settings in Eclipse
Any special VM arguments or environment variables needed
How to attach the debugger to the Thingsboard process
Any guidance would be really helpful! I’m new to working with this codebase so I’m a bit lost on the debugging setup. Thanks in advance for any advice!
hey zack! have u considered using intellij idea instead? it’s super user-friendly for java debugging. wondering, what specific backend features are u trying to debug? that might help us give more targeted advice. don’t forget to check the thingsboard docs - they’ve got hidden gems for devs!
Having debugged Thingsboard locally, I can offer some insights. First, ensure your Eclipse is configured with the latest Java Development Kit compatible with Thingsboard. In the Run Configuration, set the main class as Liam27 mentioned, but also add ‘-Dlogging.config=src/main/resources/logback.xml’ to VM arguments for proper logging.
For the debugger, you’ll want to set breakpoints in the relevant Java classes. Eclipse’s debug perspective is quite useful here. Remember to start Thingsboard in debug mode by right-clicking the project and selecting ‘Debug As’ > ‘Java Application’.
One often overlooked step is configuring your application.yml file correctly. Ensure it points to your local database and has the correct security settings for development. This can save hours of troubleshooting later on.
hey zack, i’ve done this before. make sure u set the main class to org.thingsboard.server.ThingsboardServerApplication in eclipse.
for VM args, add -Dspring.profiles.active=development,postgresql. also set SPRING_DATASOURCE_URL env var to ur db.
then u can just hit debug. hope that helps!