views:

46

answers:

2

I'm fairly new to java/eclipse development and I'm having a bit of a problem debugging code from a specific jar in a web app that my company uses.

First off, I have Tomcat setup properly and can run the webapp successfully (other than the bug that I'm trying to find!). There are about two dozen jar files in the lib directory for the webapp, and when I've tried to debug files in other jars the debugger catches their breakpoints correctly and everything is happy. Breakpoints I set in code in the new jar are skipped, and when I catch a breakpoint further along the debug stack any attempt to click to the class I'm interested in results in "Source not found".

I click the "Edit Source Lookup Path..." button, click the project that contains the code, and it simply returns me to the "Source not found" error. I've tried setting up the lookup path both as a project as well as a File System Directory and a Workspace Project. Same result every time.

I'm a little fuzzy on how exactly the debugger ties a particular function call in the debug stack window to source code - is it simply based on the package and class name of the course file? If so, I can't see why it wouldn't be working.

Any ideas?

A: 

Make sure you are pointing at the right directory. If the class was com.foo.SomeClass then you need to set the src directory to the base directory such that Eclipse can find $basedir/com/foo/SomeClass.java. This isn't necessarily the root of the project, it might be $project/src, or even $project/src/main/java for Maven projects.

locka
When I add the Source Lookup Path as a Java Project that's currently in the workspace, shouldn't that guarantee that it's looking in the right place? That's how I've added the other jars that are debug-able.
ElDuderino
A: 

Turns out I was missing the fact that a project was renamed, moved to a different repo and had a nearly identical package name... operative word being "nearly". Thanks locka for the only response!

com.companyname.java.x.y.z.classname != com.companyname.java.y.z.classname

ElDuderino