You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Jörn Kottmann <jo...@infopaq.dk> on 2009/11/17 18:19:55 UTC

How to avoid message localization failed ?

Hello,

on our sever message localization always fails with this error message:
MESSAGE LOCALIZATION FAILED: Can't find bundle for base name 
jms_adapter_messages, locale en_DK

This is a little annoying because even in case it fails it should just 
use english error messages,
and if that fails the key of the error message is better than nothing.

Should I open a jira ?

Jörn

Re: How to avoid message localization failed ?

Posted by Marshall Schor <ms...@schor.com>.

Jörn Kottmann wrote:
> Jörn Kottmann wrote:
>> Marshall Schor wrote:
>>> Jörn Kottmann wrote:
>>>  
>>>> Hello,
>>>>
>>>> on our sever message localization always fails with this error
>>>> message:
>>>> MESSAGE LOCALIZATION FAILED: Can't find bundle for base name
>>>> jms_adapter_messages, locale en_DK
>>>>
>>>> This is a little annoying because even in case it fails it should just
>>>> use english error messages,
>>>> and if that fails the key of the error message is better than nothing.
>>>>
>>>> Should I open a jira ?
>>>>     
>>> The localization code already is trying various variations, down to the
>>> "base name" by itself. It's the Java standard "getBundle" in the
>>> standard Java class ResourceBundle.  The base name here is
>>> jms_adapter_messages, and there is supposed to be a
>>> jms_adapter_messages.properties file on the classpath (it's in
>>> uimaj-as-jms project, in src/main/resources).
>>>
>>> Can you find out why this is not on the classpath?
>>>   
>> The exception was thrown in the our UIMA AS client which is running
>> in an OSGI server using the uima as osgi bundle. Who exactly is trying
>> to load the message file from the classpath ?
>>
>> I guess thats done in the uima core and uima core cannot see the
>> classpath
>> of the uima as bundle. This would explain why it fails in an osgi
>> environment.
> Ok, I added Eclipse-RegisterBuddy to the uima as bundle and then it is
> possible
> to locate the exception message file, but I guess that is not part of
> the OSGI standard.
> Anyway with Spring DM Server it works.
>
> I suggest to add it to the manifest, what do others think ?
+1 (unless there's some subtle difficulty this causes which I'm unaware of)
-Marshall
>
> Jörn
>
>

Re: How to avoid message localization failed ?

Posted by Jörn Kottmann <ko...@gmail.com>.
Jörn Kottmann wrote:
> Marshall Schor wrote:
>> Jörn Kottmann wrote:
>>  
>>> Hello,
>>>
>>> on our sever message localization always fails with this error message:
>>> MESSAGE LOCALIZATION FAILED: Can't find bundle for base name
>>> jms_adapter_messages, locale en_DK
>>>
>>> This is a little annoying because even in case it fails it should just
>>> use english error messages,
>>> and if that fails the key of the error message is better than nothing.
>>>
>>> Should I open a jira ?
>>>     
>> The localization code already is trying various variations, down to the
>> "base name" by itself. It's the Java standard "getBundle" in the
>> standard Java class ResourceBundle.  The base name here is
>> jms_adapter_messages, and there is supposed to be a
>> jms_adapter_messages.properties file on the classpath (it's in
>> uimaj-as-jms project, in src/main/resources).
>>
>> Can you find out why this is not on the classpath?
>>   
> The exception was thrown in the our UIMA AS client which is running
> in an OSGI server using the uima as osgi bundle. Who exactly is trying
> to load the message file from the classpath ?
>
> I guess thats done in the uima core and uima core cannot see the 
> classpath
> of the uima as bundle. This would explain why it fails in an osgi 
> environment.
Ok, I added Eclipse-RegisterBuddy to the uima as bundle and then it is 
possible
to locate the exception message file, but I guess that is not part of 
the OSGI standard.
Anyway with Spring DM Server it works.

I suggest to add it to the manifest, what do others think ?

Jörn

Re: How to avoid message localization failed ?

Posted by Marshall Schor <ms...@schor.com>.

Jörn Kottmann wrote:
> Marshall Schor wrote:
>> Jörn Kottmann wrote:
>>  
>>> Hello,
>>>
>>> on our sever message localization always fails with this error message:
>>> MESSAGE LOCALIZATION FAILED: Can't find bundle for base name
>>> jms_adapter_messages, locale en_DK
>>>
>>> This is a little annoying because even in case it fails it should just
>>> use english error messages,
>>> and if that fails the key of the error message is better than nothing.
>>>
>>> Should I open a jira ?
>>>     
>> The localization code already is trying various variations, down to the
>> "base name" by itself. It's the Java standard "getBundle" in the
>> standard Java class ResourceBundle.  The base name here is
>> jms_adapter_messages, and there is supposed to be a
>> jms_adapter_messages.properties file on the classpath (it's in
>> uimaj-as-jms project, in src/main/resources).
>>
>> Can you find out why this is not on the classpath?
>>   
> The exception was thrown in the our UIMA AS client which is running
> in an OSGI server using the uima as osgi bundle. Who exactly is trying
> to load the message file from the classpath ?
>
> I guess thats done in the uima core 

Right.  it's in org.apache.uima.internal.util.I18nUtil.

> and uima core cannot see the classpath
> of the uima as bundle. This would explain why it fails in an osgi
> environment.
>

Yes. This is a common problem for OSGi packaging with logging.  In the
Eclipse/OSGi environment, we "get around" this issue using buddy
class-loading.  Google:  osgi logging classpath buddy    to see a bunch
of posts about this issue.

Here's a post by Mirko Jahn which includes a part describing a way to
extend the implementation to handle this more directly (see 2nd
article): http://osgi.mjahn.net/category/specifications/

If anyone has the time and interest, it would be good to explore this to
see if we can come up with a way to make UIMA more OSGi - friendly in
this aspect.

Would a simple work-around be to change the osgi setup you're using so
that the base uima bundle can "see" the uima-as bundle?

-Marshall
> Jörn
>
>

Re: How to avoid message localization failed ?

Posted by Jörn Kottmann <ko...@gmail.com>.
Marshall Schor wrote:
> Jörn Kottmann wrote:
>   
>> Hello,
>>
>> on our sever message localization always fails with this error message:
>> MESSAGE LOCALIZATION FAILED: Can't find bundle for base name
>> jms_adapter_messages, locale en_DK
>>
>> This is a little annoying because even in case it fails it should just
>> use english error messages,
>> and if that fails the key of the error message is better than nothing.
>>
>> Should I open a jira ?
>>     
> The localization code already is trying various variations, down to the
> "base name" by itself. It's the Java standard "getBundle" in the
> standard Java class ResourceBundle.  The base name here is
> jms_adapter_messages, and there is supposed to be a
> jms_adapter_messages.properties file on the classpath (it's in
> uimaj-as-jms project, in src/main/resources).
>
> Can you find out why this is not on the classpath?
>   
The exception was thrown in the our UIMA AS client which is running
in an OSGI server using the uima as osgi bundle. Who exactly is trying
to load the message file from the classpath ?

I guess thats done in the uima core and uima core cannot see the classpath
of the uima as bundle. This would explain why it fails in an osgi 
environment.

Jörn

Re: How to avoid message localization failed ?

Posted by Marshall Schor <ms...@schor.com>.

Jörn Kottmann wrote:
> Hello,
>
> on our sever message localization always fails with this error message:
> MESSAGE LOCALIZATION FAILED: Can't find bundle for base name
> jms_adapter_messages, locale en_DK
>
> This is a little annoying because even in case it fails it should just
> use english error messages,
> and if that fails the key of the error message is better than nothing.
>
> Should I open a jira ?
The localization code already is trying various variations, down to the
"base name" by itself. It's the Java standard "getBundle" in the
standard Java class ResourceBundle.  The base name here is
jms_adapter_messages, and there is supposed to be a
jms_adapter_messages.properties file on the classpath (it's in
uimaj-as-jms project, in src/main/resources).

Can you find out why this is not on the classpath?

-Marshall
>
> Jörn
>
>