Skip to main content

java.lang.NoClassDefFoundError: com.sun.demo.jvmti.hprof.Tracker

2 replies [Last post]
vss
Offline
Joined: 2007-12-06
Points: 0

I've built cdc on linux-x86 with JVMPI and JVMTI enabled. Now I'm trying to run hprof:

>bin/cvm -agentlib:jvmtihprof -cp testclasses.zip Test

It prints some configuration settings, and then:

CVMjniExceptionDescribe failed: couldn't print stack trace.
Using brute force method to print stack trace.
java.lang.NoClassDefFoundError: com.sun.demo.jvmti.hprof.Tracker
at sun.io.ByteToCharUTF8.()V(ByteToCharUTF8.java:44)
at sun.io.Converters.newConverter(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;(Converters.java:242)
at sun.io.Converters.newConverter(ILjava/lang/String;)Ljava/lang/Object;(Converters.java:266)
at sun.io.ByteToCharConverter.getConverter(Ljava/lang/String;)Lsun/io/ByteToCharConverter;(ByteToCharConverter.java:84)
at java.lang.StringCoding.decode(Ljava/lang/String;[BII)[C(StringCoding.java:252)

How to fix that? Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
billp
Offline
Joined: 2006-09-19
Points: 0

When running jvmtihprof you have to make sure that the java_crw_demo.jar is in the bootclasspath like so:

bin/cvm -agentlib:jvmtihprof -Xbootclasspath/a:/path/to/java_crw_demo.jar -classpath testclasses.zip Test

By default the jar file gets built in the lib subdirectory of your build area.

vss
Offline
Joined: 2007-12-06
Points: 0

Yes, thanks a lot! It helped. I had to rebuild the Tracker class for Java 1.3, though, because using java_crw_demo.jar gave an error:

java.lang.UnsupportedClassVersionError: com/sun/demo/jvmti/hprof/Tracker (Unsupported major.minor version 50.0)

Anyway, jvmtihprof works now, thanks.