Register a javaagent during "Debug As" from Eclipse

873 views
Skip to first unread message

Madhusudhana Sadagopan

unread,
Jun 7, 2011, 2:33:12 AM6/7/11
to testng-dev

Hi Cédric:

I'm using testng eclipse plugin 6.0.1 (the latest version). I need to
register a javaagent to weave the JPA entities and configured VM
arguments

-javaagent:\repository\org\springframework\spring-instrument
\3.0.5.RELEASE\spring-instrument-3.0.5.RELEASE.jar

In Eclipse Helios, "Run As > TestNG Test" registers the agent and the
dynamic weaving happens as expected. But when I try to debug "Debug As
> TestNG Test" it fails with the following message

"Couldn't not contact the RemoteTestNG client. Make sure you don't
have older version of testng.jar on your classpath."

I'm looking for pointers to enable dynamic weaving during the "Debug
As > TestNG " runs. Thank you.

regards,
Madhu

Cédric Beust ♔

unread,
Jun 7, 2011, 12:58:45 PM6/7/11
to testn...@googlegroups.com
Hi Madhu,

That's odd, there shouldn't be any connection between the problem you are seeing and whether you are launching a "Run as" or "Debug as" configuration.

What do I need to reproduce the problem, just the jar file of your Java agent? If so, can you email it to me directly and give me whatever instructions you think I need?

Thanks.

-- 
Cédric





--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To post to this group, send email to testn...@googlegroups.com.
To unsubscribe from this group, send email to testng-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-dev?hl=en.


Madhusudhana Sadagopan

unread,
Jun 7, 2011, 3:59:52 PM6/7/11
to testn...@googlegroups.com
Hi Cedric:

I created a Maven project to recreate the issue and attached the same.
I tested this on the latest Eclipse Helios with TestNG 6.0.1

Steps to recreate the problem:
1) mvn clean install eclipse:eclipse
2) test > java > bug > JavaAgentTest.java

Its a simple test case and the catch is it extends
"AbstractTestNGSpringContextTests".

3) "Run As" > TestNG Test and configure the vm arguments

javaagent:<M2_REPO>\repository\org\springframework\spring-instrument\3.0.5.RELEASE\spring-instrument-3.0.5.RELEASE.jar

The tests should pass without any problem

4) "DeBug As" > TestNG Test and configure the same vm argument


You will get a popup saying unable to connect the RemoteTestNG client.
The whole issue disappears if I don't extend from
"AbstractTestNGSpringContextTests". I attached the stack trace and
seems like a classloader issue in Spring/TestNG and I can't pinpoint
exactly the root cause of the issue.

Thank you very much for offering to investigate the issue.

regards,
Madhu

2011/6/7 Cédric Beust ♔ <ced...@beust.com>:

stack-trace.txt.txt
bug.zip
Reply all
Reply to author
Forward
0 new messages