I've found it helps JAXB to init itself :) But the bundle problem shows up again later when I try to unmarshal my XML file :( Looks like JAXB is trying to re-load the same bundle with the default class loader...
Thanks for your help. Vincent. > -----Original Message----- > From: ext Steve Short [mailto:[EMAIL PROTECTED] > Sent: Monday 6 June 2005 17:46 > To: James Users List > Subject: RE: ResourceBundle.getBundle() fails > > > How about: > > ResourceBundle.getBundle("com.sun.xml.bind.Message", > > Thread.currentThread().getContextClassLoader()); > > ? > Steve > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > > Sent: Monday, June 06, 2005 12:46 AM > To: [email protected] > Subject: RE: ResourceBundle.getBundle() fails > > I tried this and I failed also :( > I don't have a clue why. > > Thanks for your help. > > > -----Original Message----- > > From: ext Noel J. Bergman [mailto:[EMAIL PROTECTED] > > Sent: Monday 6 June 2005 03:54 > > To: James Users List > > Subject: RE: ResourceBundle.getBundle() fails > > > > > > [EMAIL PROTECTED] wrote: > > > > > JAXB init fails because its > > > ResourceBundle.getBundle("com.sun.xml.bind.Message") > > > fails with a java.util.MissingResourceException > > > > > I tried a > > > System.out.println("resource is: " + > > > > > this.getClass().getClassLoader().getResource("com/sun/xml/bind/Message > > .properties")); > > > > > wich works. > > > > ResourceBundle.getBundle(...) plays games on the stack and > finds the > > classloader that loaded JAXB, which is not the same as the > classloader > > > for your matcher. If you were to call: > > > > ResourceBundle.getBundle("com.sun.xml.bind.Message", > > this.getClass().getClassLoader()); > > > > I suspect it would work. > > > > --- Noel > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
