NoClassDefFoundError while using probe through plugin [message #95399] |
Wed, 11 April 2007 11:44  |
Eclipse User |
|
|
|
Hi there,
i am still working on using ProbeKit to create a dynamic callgraph
(remember?). Meanwhile i succeeded in creating the callgraph by using the
probe directly in my plugin development project (probing a little
testclass). Now i would like it buid this into my plugin.
First i had to learn, that i have to register the probe with every new
eclipse instance (right? are there other possibilities?). I accomplished
that by exporting the probe to a probekit file and importing it
programmatically while starting my plugin in the new eclipse instance (using
ProbekitRegistry). Now the probe is present in the profile launch
configuration (marked as imported).
So far so good ... if i start profiling i unfortuantely get a
NoClassDefFoundError. My generated probe looks like this:
<codeExample>
// generated source from Probekit compiler
// "imports" specifications for probes (if any):
import java.util.HashMap; // from unnamed_probe
import java.util.Stack; // from unnamed_probe
import java.util.EmptyStackException; // from unnamed_probe
import org.projectory.ezunit.internal.callgraph.CallgraphElement; // from
unnamed_probe
import org.projectory.ezunit.internal.callgraph.CallgraphManager; // from
unnamed_probe
[...]
public static void _entry(String /* className */className,
String /* methodName */methodName, String /* methodSig */methodSig,
Object /* thisObject */thisObject, Object[] /* args */args,
String /* classSourceFile */classSourceFile,
String /* methodNames */methodNames,
String /* methodLineTables */methodLineTables,
int /* methodNumber */methodNumber)
{
// Internal signature for this method:
//
(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava /lang/Object;[Ljava/lang/Object;Ljava/lang/String;Ljava/lang /String;Ljava/lang/String;I)V
// ------------------ begin user-written fragment
code ----------------
Stack<CallgraphElement> stack = map.get(Long.valueOf(Thread
.currentThread().getId()));
if (stack == null)
{
stack = new Stack<CallgraphElement>();
map.put(Long.valueOf(Thread.currentThread().getId()), stack);
}
CallgraphElement parentElement = null;
CallgraphElement currentElement = new CallgraphElement(className,
methodName, methodSig, thisObject, args, classSourceFile,
methodNames, methodLineTables, methodNumber);
if (!stack.empty())
{
parentElement = stack.peek();
}
synchronized (stack)
{
CallgraphManager.getInstance().getCallgraph().enter(currentE lement,
parentElement);
stack.push(currentElement);
}
// ------------------- end user-written fragment
code -----------------
}
</codeExample>
And as you could image the classes "CallgraphElement" and "CallgraphManager"
could not be found.
Furthermore i exported the specific package of my plugin to a jar and put a
reference to any location that might make sense to me (e.g. buildPath,
ClassPath in Profiling launch configuration).
No success. Probably you could give a hint where to put the classes to.
Thanks in advance,
Thomas E.-E.
|
|
|
|
Re: NoClassDefFoundError while using probe through plugin [message #95625 is a reply to message #95567] |
Thu, 12 April 2007 11:26  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_015B_01C77D27.C28EBF40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Navid,
that did the job! Thanks a lot!
Cheers,
Thomas E.-E.
"Navid_Mehregani" <nmehrega@ca.ibm.com> schrieb im Newsbeitrag =
news:evlfgg$riv$1@build.eclipse.org...
Hi Thomas,=20
The Probekit classes are loaded by the boot classloader in order to =
allow Probekit to instrument java.* classes. If your probe class =
references any other classes, it won't be able to "see" them unless =
they're also loaded in the boot class loader. Thus, specifying the =
external classes under your system classpath is not sufficient. They =
have to be loaded by the boot classloader. You can load your external =
classes in the boot classloader by specifying the following VM argument: =
-Xbootclasspath/a:<path>=20
Navid Mehregani=20
nmehrega@ca.ibm.com
------=_NextPart_000_015B_01C77D27.C28EBF40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16414" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Navid,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>that did the job! Thanks a =
lot!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Cheers,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thomas E.-E.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Navid_Mehregani" <<A=20
href=3D"mailto:nmehrega@ca.ibm.com">nmehrega@ca.ibm.com</A>> =
schrieb im=20
Newsbeitrag <A=20
=
href=3D"news:evlfgg$riv$1@build.eclipse.org">news:evlfgg$riv$1@build.ecli=
pse.org</A>...</DIV><BR><FONT=20
face=3Dsans-serif size=3D2>Hi Thomas,</FONT> <BR><BR><FONT =
face=3Dsans-serif=20
size=3D2>The Probekit classes are loaded by the boot classloader in =
order to=20
allow Probekit to instrument java.* classes. If your probe class =
references any other classes, it won't be able to "see" them unless =
they're=20
also loaded in the boot class loader. Thus, specifying the =
external=20
classes under your system classpath is not sufficient. They have =
to be=20
loaded by the boot classloader. You can load your external =
classes in=20
the boot classloader by specifying the following VM argument:=20
-Xbootclasspath/a:<path></FONT> <BR><BR><FONT face=3Dsans-serif=20
size=3D2>Navid Mehregani</FONT> <BR><FONT face=3Dsans-serif=20
size=3D2>nmehrega@ca.ibm.com</FONT></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_015B_01C77D27.C28EBF40--
|
|
|
Powered by
FUDForum. Page generated in 0.24895 seconds