1

I have a little project (guestbook, google example in java appengine documentation). https://developers.google.com/appengine/docs/java/gettingstarted/creating In this little project i had a problem when i want to do a debug step by step (F5). The step into doesn't work and i get a message in eclipse "source not found" with a button "edit source lookup path".

it seems the problem is known because i found similar posts on stack overflow but i didn't find solution for my case and the solution are sometimes quite different (ok ok i keep open minded). It seems there is a problem with the class path if i read this post.

In this post (the most complete i found on the topic) there are many things that i tested. Eclipse java debugging: source not found

For example, i have changed the definiton in preference>java>installed JRE but it is the same result... I have tried to create a new debug configuration too and many other things in this window. I need help to understand and configure Eclipse, hoping do not have break all my eclipse installation with my different test... tonight i have taken the decision to install a fresh copy of eclipse... but same results....

I have the conf below... eclipse keepler Release 1 google plugin for eclipse 3.5.1 appengine-java-sdk-1.8.8

thanks by advance for your help

edit 15.01.2014

the code is almost the same as google code. In debug mode, the perspective view is open when i get http://localhost:8888/guestbook, the breakpoint is highlighted and if i press F5, i get the error message "source not found" with the button.

package com.example.Guestbook;
import java.io.IOException;
import javax.servlet.http.*;

public class GuestbookServlet extends HttpServlet {

    @Override
    public void doGet(HttpServletRequest req, HttpServletResponse resp)  throws IOException {
        resp.setContentType("text/plain");
        resp.getWriter().println("Hello, world 1");
        resp.getWriter().println("Hello, world 2");
        resp.getWriter().println("Hello, world 3");

        resp.getWriter().println("breakpoint here " + this.myFunction()); // the breakpoint is here
    }


    // this method is not in the original google example
    public int myFunction(){
        int i=10;
        return i;
    }   
}
Community
  • 1
  • 1
grome55
  • 653
  • 1
  • 8
  • 12
  • Are you asking about stepping into code from the demo itself or App Engine API code? – R Samuel Klatchko Jan 14 '14 at 23:00
  • What is the exact line of code you are trying to debug? – Lyn Headley Jan 15 '14 at 02:01
  • It depends on the line of code that you are trying to get into. Typically for your own sources (Application Project classes/methods), you should be able to Step In. But if the code is present in the framework classes, then you are likely to see that error. So please let us know which line of code you are trying to step into. – Romin Jan 15 '14 at 05:41
  • look above i added code... thanks – grome55 Jan 15 '14 at 06:35

1 Answers1

0

I sometimes trigger the same error, but there is often a way to avoid it. The solution in Eclipse is to use F6 (Step Over) instead of F5 (Step Into). Your breakpoint is probably on a line that calls code in a library outside of your project and it is the library whose source is unavailable. You don't want to step into the external library source code.

In your source code example, if you cannot single step from the line containing "breakpoint here " when it breaks there, try adding an additional breakpoint on the line containing "int i=10;" and then pressing F8 (Resume) instead.

Martin Berends
  • 3,948
  • 2
  • 16
  • 19
  • thanks a lot for your answer. if i use F6 (step over) or F5 (step into) whith a breakpoint on the line "int i =10" , i get the same message at the end of execution when i return in the methode doGet. This solution could be a good solution with this code because it's an example but on a real situation, the "step into" function is needed. Imagine if you cannot use "step into" in your own class, it' s a problem, no ? Thanks again Martin – grome55 Jan 16 '14 at 10:20
  • Jerome I agree with you that Eclipse sometimes should Step Into but fails to do so. We can consider it an Eclipse bug that we don't know how to fix. The additional breakpoint and then F8 technique is a workaround merely for when Eclipse is not playing nicely and you want to single step inside your called methods. Inconvenient but better than not working at all. – Martin Berends Jan 16 '14 at 17:21