Stuck
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Tue Oct 16 14:16:00 GMT 2001
It looks like the same class is being registered twice? The problem is
that _Jv_RegisterClassHookDefault can throw, but _Jv_RegisterClasses is
called during class registration, before the runtime is initialized, so
there is no exception handler yet, so it aborts. We should probibly set
up some kind of default behaviour for when there is no exeption handler
(this could be useful for JNI as well), but that is a different matter.
Try something like the following patch to help to diagnose the problem
(untested):
diff -u -r1.38 natClassLoader.cc
--- natClassLoader.cc 2001年10月16日 08:35:17 1.38
+++ natClassLoader.cc 2001年10月16日 21:15:12
@@ -438,6 +448,8 @@
}
}
+#include <stdio.h>
+
void
_Jv_RegisterClassHookDefault (jclass klass)
{
@@ -452,7 +464,8 @@
{
// If you get this, it means you have the same class in two
// different libraries.
- throw new java::lang::VirtualMachineError (JvNewStringLatin1
("class registered twice"));
+ printf ("Class already registered: %s\n", klass->name->data);
+ //throw new java::lang::VirtualMachineError (JvNewStringLatin1
("class registered twice"));
}
check_class = check_class->next;
regards
Bryce
Torsten Rüger wrote:
> I'm stuck with this one below.
>> I have spend days now, getting new versions, moving to just java (no
> class files), now I'm stuck. If there's help out there, I can try a
> little more, but generally I conclude the experiment as closed.
> (I'll try again later, maybe next year)
>> Cheers
> Torsten
>> #0 0x40520801 in __kill () from /lib/i686/libc.so.6
> #1 0x404d361b in raise (sig=6) at signals.c:65
> #2 0x40521d82 in abort () at ../sysdeps/generic/abort.c:88
> #3 0x4019c9a7 in _Jv_Throw (value=0x8598ff0) at
> ../../../gcc/libjava/exception.cc:100
> #4 0x401b0e02 in _Jv_RegisterClassHookDefault () at
> ../../../gcc/libjava/gcj/cni.h:64
> #5 0x401b0cd2 in _Jv_RegisterClasses (classes=0x84ea280)
> at ../../../gcc/libjava/java/lang/natClassLoader.cc:444
> #6 0x08064c8d in frame_dummy ()
> #7 0x08061d2d in _init ()
> #8 0x4050f161 in __libc_start_main (main=0x8064c98 <main>, argc=1,
> ubp_av=0xbffff874,
> init=0x8061d1c <_init>, fini=0x8343a04 <_fini>,
> rtld_fini=0x4000e184 <_dl_fini>,
> stack_end=0xbffff86c) at ../sysdeps/generic/libc-start.c:122
>
More information about the Java
mailing list