[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [equinox-dev] Classloading issue with javaagent and dedicated Eclipse application
- From: "Tomljenovic Marko (CDG-SMT/EMT1)" <Marko.Tomljenovic@xxxxxxxxxxxx>
- Date: Thu, 2 May 2013 17:24:36 +0200
- Accept-language: de-DE, en-US
- Acceptlanguage: de-DE, en-US
- Delivered-to: email@example.com
- Thread-index: Ac5HSONTGT86quXVQK+Gedjqzk7KNwAACALg
- Thread-topic: [equinox-dev] Classloading issue with javaagent and dedicated Eclipse application
Thanks for the hint.
The problem is that I cannot change the agent code since it is the regular jacoco java agent jar.
Any other ideas?
Von: equinox-dev-bounces@xxxxxxxxxxx [mailto:equinox-dev-bounces@xxxxxxxxxxx] Im Auftrag von Stephan Herrmann
Gesendet: Donnerstag, 2. Mai 2013 17:22
Betreff: Re: [equinox-dev] Classloading issue with javaagent and dedicated Eclipse application
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:
> Hi everybody,
> 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
equinox-dev mailing list