This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

shared library problems


Here's an interesting gotcha....

It's seems to be difficult to avoid loading shared libraries multiple times.
This triggers a VirtualMachineError in _Jv_RegisterClassHookDefault.

Consider this scenario... you've built package foo into a shared library,
lib-foo.so.

foo contains another package with property files...

    foo/resources/Messages.properties

If you try to load the ResourceBundle "foo.resources.Messages", it first
attempts to load the ResourceBundle class foo.resources.Messages.  This is
supposed to fail, and then the PropertyResourceBundle is created by reading
foo/resources/Messages.properties.

The trouble is that while attempting to load the non-existant class
foo.resources.Messages, the runtime finds and loads lib-foo.so, which is
already loaded.  Any suggestions on how to fix this?

Another annoyance is that while _Jv_RegisterClassHookDefault throws a
VirtualMachineError, it always simply aborts -- presumably because the
machinery for loading shared libraries (from glibc/libtldl) isn't built
with -fexceptions.

AG



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]