Subject | Re: Problems finding error messages |
---|---|
Author | ben_ata |
Post date | 2004-09-13T21:49:52Z |
--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
I just created a small test program that loads a class from a jar file
via an URLClassLoader (simulating my program loading the FB driver)
and the loaded class (the "driver") retrieves a message from a
properties file without problems.
If (in my test program) res is "isc_error_msg.properties" then it
works only if the class (the "driver") is loaded via the system
classloader.
But if the resource name is prepended with a slash to indicate that
it's located in the root directory, then it works with both approaches.
Maybe this helps
Cheers
Thomas
> The following code is used to load error messages:What is the content of "res"?
>
> InputStream in = GDSException.class.getResourceAsStream(res);
>
I just created a small test program that loads a class from a jar file
via an URLClassLoader (simulating my program loading the FB driver)
and the loaded class (the "driver") retrieves a message from a
properties file without problems.
If (in my test program) res is "isc_error_msg.properties" then it
works only if the class (the "driver") is loaded via the system
classloader.
But if the resource name is prepended with a slash to indicate that
it's located in the root directory, then it works with both approaches.
Maybe this helps
Cheers
Thomas