1

I have been trying to debug and look through the internals of Play! Frameworks Controller class. If I place break points on the Controller.class, the debugger stops at the break point but throws a "Source Not Found"

I have added play.jar and the project is in path. Even added a Java Classpath called "Play_Home" which points to the Play framework.

Update I been able to always debug my code (your solutions don't help me). When I plan a breakpoint on Play's internal classes like Controller, the debugger stops and says "Source not found"

Sameer Segal
  • 21,813
  • 7
  • 42
  • 56

1 Answers1

1

(This answer is almost a straight copy of my own answer to another question that touches the same topic. I assume the problem in your case will be solved by running the eclipsify command, as another user has already mentioned.)


  • Create the configuration files for Eclipse by running play eclipsify YourProject command. (See Play framework documentation for more information.)

  • You should now have a folder named eclipse in your project. In it, you should see commands Connect JDPA to YourProject.launch, YourProject.launch and Test YourProject.launch.

  • Right-click on the YourProject.launch and choose Run As --> YourProject from the pop-up menu. That will start your application. When the application is running, right-click on the Connect JDPA to YourProject.launch, and choose Debug As --> Connect JDPA to YourProject.launch from the pop-up menu. That will start a debug session on your application.

Community
  • 1
  • 1
Tommi
  • 8,550
  • 5
  • 32
  • 51
  • I am able to debug my code. However, when I place a break point in one of Play's classes: the debugger stops at the right break point and says "source not found" – Sameer Segal Feb 22 '12 at 20:47
  • Is your Play installation complete then? If it is, `eclipsify` command should automatically create correct project settings for Eclipse. – Tommi Feb 23 '12 at 05:50
  • Yes eclipsify works. I am able to debug and stop at breakpoints in my code. But I want to place breakpoints inside Controller.class and see how templates are getting rendered – Sameer Segal Feb 24 '12 at 10:09
  • 1
    Well, it works for me, and I haven't done any "extra tricks" (in addition to above) to achieve it. Perhaps you should check Java Build Path in your Eclipse - look for the play jar file and see if the source attachment is set correctly. It's pointing at the play/framework directory on my workspace. – Tommi Feb 24 '12 at 10:18
  • And I wonder what the downvote was for, whoever it was... I think this answer is not that much off. – Tommi Feb 24 '12 at 10:19
  • Your answer was right. However in addition, I had to re-import the play application into eclipse. Thanks for the help – Sameer Segal Feb 27 '12 at 05:09
  • This is not relevant to Play 2 – Nikolay Kuznetsov Sep 24 '13 at 17:54