thanks for your reply, i'm not using java 1.3, but 1.4.2 and the tomcat 5.0.28. i'm currently working on 'local' webapplication, where the client and server are located at the same maschine. to protect our own code we are using a different bootclassloader. maybe we should look there.

regards

ronald


Simon Kitching schrieb:
R. Müller wrote:

I'm surprised that this is null. The classloader hierarchy for modern jvms should be something like:

bootloader
endorsed-extensions classloader
system classloader
tomcat shared classloader
webapp classloader

I expect stuff in the tomcat-endorsed directory gets loaded via the endorsed-extensions classloader.

The bootloader is a special one; classes that are loaded by it do indeed return null for getClassLoader(). However unless you're mucking around with -Xbootclasspath command-line options, only classes from the JDK (java.*) will be loaded by this.

So in your case, facesContext.getClass().getClassLoader() should be returning the endorsed-extensions classloader which will NOT be null. So I can't understand why you are getting the results you see.

You aren't using java 1.3 are you?

There are several other approachs to load the bundle then, by catching a MissingResourceException, but thats not the point here, there occured a NullPointerExcpetion.

I've commentet out all the stuff and load the bundle simply with :

ResourceBundle.getBundle(bundleName,locale)

without any special classloader and it works for me. :-)

If some can explain this i would very appriciate...

Have a look at the javadoc for the ResourceBundle.getBundle method. It says that the classpath it uses to try to find the resource is that of "the caller's classloader".

Suppose you write a custom FacesContext class, and bundle it with your webapp, but have the myfaces.jar in a shared dir of the appserver. In this case, the existing code will look in your webapp for the resource bundle file, while your code will not.

There are no doubt other setups where this code makes a difference. In other words, great care would be needed before making any modifications to this code.

Regards,

Simon


--
*********************************************************
*M-Unicomp GmbH
*
*Dipl.-Ing. Ronald Müller
*Softwareentwicklung
*
*Plauener Straße 163-165, Haus 11
*13053 Berlin
*
*fon   : +49 ( 0 ) 30  / 98 69 61 54
*mobil : +49 ( 0 ) 172 / 93 95 00 4
*fax   : +49 ( 0 ) 30  / 98 69 61 55
*email : [EMAIL PROTECTED]
*web   : www.unicomp-berlin.de
********************************************************

Reply via email to