Hip Hip Array
Hip Hip Array

Reputation: 4753

eclipse debug: Source not found for

I know this is a frequently asked question, but i have been searching for a solution for my problem online since yesterday and have not been able to find any!

I am using Eclipse Helios with Tomcat 6.0.2, when ever I try to debug my code using the tomcat and eclipse i am getting the error Source not found, this is the case for even the code that i have wrote myself and not just all the jar files

I have the java build path set up correctly, I am also using jdk1.6.0 and have this set up correctly as well so that is not the problem, it does show the code when i am debugging if i right click on the debug console and go to Edit Source Lookup.... Because this will show the source code just for that run of the debugger, I when into Run -> Debug Configurations and in the Java Application window i set it up to work with Tomcat and in the source tab I added my project and all the jar files but this does not work either! when i debug again and go into the Edit Source Lookup... it does not show me the project and jar files that I have saved in there

Does anybody have any ideas what might be happening?

Upvotes: 8

Views: 10227

Answers (3)

Hip Hip Array
Hip Hip Array

Reputation: 4753

I have solved my problem, well in a roundabout way. In my catalina.bat file I have added the line

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

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

Hope this helps others that have this problem

Upvotes: 1

Shiv Kumar Ganesh
Shiv Kumar Ganesh

Reputation: 3825

Its actually very easy.Click on "Edit Source Look Path". You ll get the next popup where you need to click "Add"--> This gives another popup where you could click on "Java Project"---> THis leads to another popup where you can select your project which you are debugging and this is done! Hope this works fine.

enter image description here

Upvotes: 9

Moataz Elmasry
Moataz Elmasry

Reputation: 2519

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

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

Upvotes: 0

Related Questions