Eclipse debugging: source not found for

I know this is a frequently asked question, but I have been looking for a solution to my problem online since yesterday and could not find anyone!

I use Eclipse Helios with Tomcat 6.0.2, when I ever try to debug my code with tomcat and eclipse, I get a Source not found error message, this even applies to the code that I wrote myself and not only all jar files

I have the java build path set correctly, I also use jdk1.6.0 and configured it correctly so that is not a problem, it shows the code when I debug if I right-click on the debug console and go to Edit Source Lookup... .. Since this will only show the source code for this debugger launch, when I set it in Run -> Debug Configurations and in the Java Application window to work with Tomcat and in the source tab, I added my project and all the jar, but that will not work either! when I debug again and go to Edit Source Lookup... it doesn't show me the project files and jar that I saved there

Does anyone have any ideas what could happen?

+8
java debugging eclipse tomcat
source share
3 answers

I solved my problem, well, on a workaround. In my catalina.bat file, I added the line

set JAVA_OPTS= -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=5001,server=y,suspend=n %JAVA_OPTS%

below where JAVA_OPTS set, this will listen on socket 5001 for any debugging requests. Then in eclipse under Debug Configurations... I created a new Remote Java Application and set the port to 5001 so that Tomcat would take it. Now when I launch tomcat using startup.bat , when the code hits the breakpoint, it opens in eclipse and I can debug like normal

Hope this helps others who have this problem.

+1
source share

This is actually very simple. Click "Change source path." You will get the following pop-up window where you need to click “Add” → This gives another pop-up window where you can click “Java Project” ---> This leads to another pop-up menu where you can select your project that you are debugging and done! Hope this works great.

enter image description here

+8
source share

Is it possible to debug code in other projects? if you don’t know, create a new dummy project and try to debug it

if you still get a source not found for all projects, then download a new copy of eclipse, attach it to a new copy of tomcat and add your dummy project to see if this work works. Hope this helps

0
source share

All Articles