shared library problems
Anthony Green
green@redhat.com
Sat Oct 6 16:10:00 GMT 2001
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
More information about the Java
mailing list