NoClassDef error when trying to preload additional class in systemDirectory::initialize_preloaded_classes()
Xiaoran Wang
xiaoran at x1a0ran.com
Sat Jun 8 13:06:55 PDT 2013
To followup, I tried to put foo/bar.class into $JAVA_HOME/jre/classes, now
the linux_amd64_compiler2/product/test_gamma passed without error, but
another error occured from linux_amd64_compiler2/jvmg/test_gamma, which is
even more confusing.
cd linux_amd64_compiler2/jvmg && ./test_gamma
java full version "1.6.0_22-b04"
Using java runtime at: /home/Documents/tools/hotspot-working-dir/java/jre
Error occurred during initialization of VM
java.lang.NoSuchMethodException: java.lang.reflect.Method.invoke
Can someone shed some light please?
On Sat, Jun 8, 2013 at 12:32 PM, Xiaoran Wang <xiaoran at x1a0ran.com> wrote:
> Hi all,
>
> I'm instrumenting the hotspot JVM for research purposes and one of the
> steps is to preload some classes during JVM startup time so that I can use
> its KlassOop/KlassHandle later in the template Interpreter.
>
> I appended the new classes I wanted to load in systemDirectory.hpp, e.g.
> *template(bar_klass, foo_bar, Pre) \*
> And its corresponding symbol in vmSymbols.hpp
> *template(foo_bar, "foo/bar")\*
>
> Then I put foo/bar.class into the corresponding rt.jar that will be used
> to build libjvm.so.
>
> However, when I built it, the "gamma" test always gives me an
> NoClassDefFoundError.
>
> cd linux_amd64_compiler2/product && ./test_gamma
> java full version "1.6.0_22-b04"
> Using java runtime at: /home/Documents/tools/hotspot-working-dir/java/jre
> Error occurred during initialization of VM
> java/lang/NoClassDefFoundError: foo/bar
>
>
> So my question is where should I put my custom class so that it can be
> preloaded during JVM startup in
> systemDirectory::initialize_preloaded_classes?
>
> btw, I verified the rt.jar is the one JVM is loading because I tried to
> remove java/lang/Object from it and it complained about missing that class
> as well.
>
> Thank you
> Xiaoran
>
More information about the hotspot-dev
mailing list