Debugging with Eclipse

363 views
Skip to first unread message

rhummy

unread,
Nov 27, 2010, 12:01:10 AM11/27/10
to play-framework
Hi,

I setup a project with play eclipsify command.
I want to debug the project.
To do that, I run "Test myproject".
Then, I launch the debug "Connect JPDA to myproject".

When i go the localhost:9000/@test, I can run the test. But the
debugger do not stop at the breakpoint.

Can somebody help me ? I do not think to program without debug tool.
Thank you and sorry for my english.

grandfatha

unread,
Nov 27, 2010, 3:48:34 AM11/27/10
to play-framework
Usually this works for me without problems, but sometimes I have an
issue with breakpoints not being hit during tests, when I refresh the
TestRunner App in my browser (after adding a new TestCase for example)
which causes Play to reload the class files, which in turn causes the
remote debugger to be out of sync. If that happens, a right-click in
the debugger's thread-window along with the selection of "Terminate
and Relaunch" in the context-menu usually solves this problem.

It is very strange that your breakpoints are not being hit at all. Can
you confirm that a simple System.out.println() works within your code,
aka, the code actually gets executed? Could you try to run play from
the command line (shouldnt change anything, but this is how I do it
and how it works for me...)?

rhummy

unread,
Nov 27, 2010, 9:08:41 AM11/27/10
to play-framework
There is something which happens in my baseTest class.

If I put a breakpoint at the beginning of the baseTest class, the
debugger hits it.
After some steps, it waits for my input with the message below :

"The jar file /home/leop/play-1.1/framework/lib/junit-4.8.1.jar has no
source attachment."
With a button to show him where the source are.

You are right, the rest of my code is not executed because eclipse
waits for my input.

rhummy

unread,
Nov 27, 2010, 9:09:48 AM11/27/10
to play-framework
Here is some other information provided below the message

// Compiled from ReflectiveCallable.java (version 1.5 : 49.0, super
bit)
public abstract class
org.junit.internal.runners.model.ReflectiveCallable {

// Method descriptor #8 ()V
// Stack: 1, Locals: 1
public ReflectiveCallable();
0 aload_0 [this]
1 invokespecial java.lang.Object() [1]
4 return
Line numbers:
[pc: 0, line: 12]
Local variable table:
[pc: 0, pc: 5] local: this index: 0 type:
org.junit.internal.runners.model.ReflectiveCallable

// Method descriptor #15 ()Ljava/lang/Object;
// Stack: 1, Locals: 2
public java.lang.Object run() throws java.lang.Throwable;
0 aload_0 [this]
1 invokevirtual
org.junit.internal.runners.model.ReflectiveCallable.runReflectiveCall() :
java.lang.Object [2]
4 areturn
5 astore_1 [e]
6 aload_1 [e]
7 invokevirtual
java.lang.reflect.InvocationTargetException.getTargetException() :
java.lang.Throwable [4]
10 athrow
Exception Table:
[pc: 0, pc: 4] -> 5 when :
java.lang.reflect.InvocationTargetException
Line numbers:
[pc: 0, line: 15]
[pc: 5, line: 16]
[pc: 6, line: 17]
Local variable table:
[pc: 6, pc: 11] local: e index: 1 type:
java.lang.reflect.InvocationTargetException
[pc: 0, pc: 11] local: this index: 0 type:
org.junit.internal.runners.model.ReflectiveCallable

// Method descriptor #15 ()Ljava/lang/Object;
protected abstract java.lang.Object runReflectiveCall() throws
java.lang.Throwable;
}

On Nov 27, 3:48 am, grandfatha <dkim...@googlemail.com> wrote:

rhummy

unread,
Nov 27, 2010, 9:31:38 AM11/27/10
to play-framework
There is an exception produced by the code but not showed in the
console. Or even by the play test framework.

grandfatha

unread,
Nov 29, 2010, 7:11:24 AM11/29/10
to play-framework
Ok that is odd. Normally Play should take care of the source
attachments during the "eclipsify" step.

Can you try to create a completely new/empty app (e.g. copy the yabe
example from the "samples-and-tests" folder of your play-home) and
eclipsify that app and try to debug something within that context and
see if that works?
Reply all
Reply to author
Forward
0 new messages