You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Vi...@nokia.com on 2005/06/02 15:03:03 UTC

ResourceBundle.getBundle() fails

Hi,

My mailet uses JAXB. JAXB uses bundles to init message strings. JAXB init fails because its ResourceBundle.getBundle("com.sun.xml.bind.Message") fails with a java.util.MissingResourceException: con't find bundle for base name com.sun.xml.bind.Message

I tried a System.out.println("resource is: " + this.getClass().getClassLoader().getResource("com/sun/xml/bind/Message.properties")); wich works.

Any idea where the problem comes from,

Thanks in advance,
Vincent.

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: ResourceBundle.getBundle() fails

Posted by Laurent Rouvet <la...@rouvet.com>.
Did you try to remove the security manager?

sh pheonix.sh check
... -Djava.security.manager          
-Djava.security.policy=jar:file:/home/james/bin/phoenix-loader.jar!/META-INF/java.policy 


?
Laurent.


Vincent.Bourdaraud@nokia.com wrote:

>Hi,
>
>My mailet uses JAXB. JAXB uses bundles to init message strings. JAXB init fails because its ResourceBundle.getBundle("com.sun.xml.bind.Message") fails with a java.util.MissingResourceException: con't find bundle for base name com.sun.xml.bind.Message
>
>I tried a System.out.println("resource is: " + this.getClass().getClassLoader().getResource("com/sun/xml/bind/Message.properties")); wich works.
>
>Any idea where the problem comes from,
>
>Thanks in advance,
>Vincent.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>For additional commands, e-mail: server-user-help@james.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


RE: ResourceBundle.getBundle() fails

Posted by "Noel J. Bergman" <no...@devtech.com>.
Vincent.Bourdaraud@nokia.com 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: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org