[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] Classloading issue with javaagent and dedicated Eclipse application
- From: Stephan Herrmann <stephan.herrmann@xxxxxxxxx>
- Date: Thu, 02 May 2013 17:22:01 +0200
- Delivered-to: email@example.com
- User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5
I don't know about your exact situation but I know about the
difficulties of communicating between a javaagent and the rest
of the world.
I'm not sure if it is even possible to let regular classes "see"
the agent, given that the agent isn't actually on the classpath.
I believe you could get the communication established like this:
- let the agent store itself in a Object-typed field of a non-agent
class that is visible to both sides (may need to be on the
- let the regular class pick up that instance and invoke methods
On 05/02/2013 04:29 PM, Tomljenovic Marko (CDG-SMT/EMT1) wrote:
I have a complex problem to solve and unfortunately I am out of ideas.
Hopefully you can help me.
My situation is like this:
I am using Eclipse 3.8 to run a headless Eclipse application (PDE
In addition the jacoco javaagent is started via –javaagent parameter to
gather code coverage.
The Jacoco javaagent is implemented via a singleton pattern.
I have written a special class that is invoked automatically by the
headless application (during the tests). This special class is a
JUnitFormatter that is used for tweaking the code coverage data for a
testcase (storing for each test case a dedicated session within the
coverage data). For that the access to the Jacoco instance is necessary.
The formatter class is contained in a bundle fragment (of
org.eclipse.test) that has a dependency to ant and junit4.
The formatter class itself can be invoked (when specifying the host as
org.eclipse.test) but then I get an exception that the Jacoco agent
class(instance) cannot be found at all.
To solve this problem I played around (according to
with system packages, extension bundles, boot delegation but none of it
worked. Either the agent class could not be found or even the
JunitFormatter class could not be found (I guess that in this case the
fragment could not be loaded due to certain dependencies).
Any idea how to solve that? Do I maybe need to change the parent
classloader when running the tests?
Thank you a lot in advance.
equinox-dev mailing list