Re: How to avoid message localization failed ?

2009-11-18 Thread Jörn Kottmann

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 ?

2009-11-18 Thread Jörn Kottmann

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 ?

2009-11-18 Thread Marshall Schor


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 buddyto 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 ?

2009-11-18 Thread Marshall Schor


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




How to avoid message localization failed ?

2009-11-17 Thread Jörn Kottmann

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 ?

2009-11-17 Thread Marshall Schor


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