I'm working on a java application which has multiple projects. So while debugging we are writing main method and calling required method from it which is increasing the time of development or fixing defects. I want to know the best way to debug if we have multiple java projects and use jboss app server
Asked
Active
Viewed 1,941 times
1
-
1actually best way to debug is a good logging system. But executing server in debug mode and adding some breakpoints into the code you want to watch will do the job. – Jordi Castilla Jul 26 '16 at 10:00
-
If I have multiple java projects then should I add Jboss server in eclipse and add multiple projects into it and start it in debug mode? – Saawan Jul 26 '16 at 10:40
-
yes... that's the usual way, but depending your scenario you may have problems with performance or syncronization, then logging system will be your friend, if you need more info check [here](https://www.javacodegeeks.com/2011/01/10-tips-proper-application-logging.html) and [here](http://stackoverflow.com/questions/7839565/logging-levels-logback-rule-of-thumb-to-assign-log-levels) – Jordi Castilla Jul 26 '16 at 10:42
-
Are all modules maven based? If yes then you can add those dependencies in respective projects and start debugging. Control will jump to a project once execution is called. – Imran Jul 26 '16 at 10:46
1 Answers
0
You can use one of the below
Enable remote debugging in JBoss
Windows - Un-comment below line in standalone.conf.bat file
rem set "JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"
Linux - Change DEBUG_MODE=false to DEBUG_MODE=true in standalone.sh file
Connect to jboss from IDE and use breakpoints to debug.
Use extensive logging to easily detect what went wrong
Or use JRebel. I heard it supports live reloading and remote code deployment. It will speed up the development

Shettyh
- 1,188
- 14
- 27
-
In JBOSS 5 I dont have standalone.conf.bat.I have run.bat in this way _"x%JAVA_OPTS%" == "x" ( set "JAVA_OPTS=-Dprogram.name=%PROGNAME%" ) else ( set "JAVA_OPTS=-Dprogram.name=%PROGNAME% %JAVA_OPTS%" )_ **please let me know what changes needs to be done for remote debugging in JBoss 5** – Saawan Jul 26 '16 at 11:03