[ 
https://issues.apache.org/jira/browse/UIMA-5961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16744204#comment-16744204
 ] 

Marshall Schor commented on UIMA-5961:
--------------------------------------

In the general case, the class loader used to find the message bundle is a 
"climbing" class-loader.  This is one that behaves like this:
1) it starts with some class loader, looks for the resource in that (and in its 
"parent" chain).  if not found,

2) it gets the classloader for the "caller" (from the call stack), and if 
different from a loader already used, looks for the resource in that (and it 
its parent chain).  If not found, repeat step 2 until you reach the top

3) if not found, use the saved "thread context class loader".

================

It sounds like the problem as reported is that the Pear's classpath contains 
the message bundle, but the pear's classpath isn't being used when inside the 
Pear.

Would a more general fix be to arrange things so that the Pear's classpath is 
used, when inside a PEAR context?  That way, users would not need to alter 
their code to call these (new) APIs with explicit classloaders.

I'm wondering if a better fix might be to set the threadLocalContextClass 
loader to the Pear's classloader, while within the PEAR and restore it when 
leaving the PEAR boundary?

> InternationalizedException getLocalizedMessage fails in pear
> ------------------------------------------------------------
>
>                 Key: UIMA-5961
>                 URL: https://issues.apache.org/jira/browse/UIMA-5961
>             Project: UIMA
>          Issue Type: Bug
>    Affects Versions: 2.10.3SDK
>            Reporter: Matthias Koch
>            Assignee: Marshall Schor
>            Priority: Major
>             Fix For: 3.0.2SDK, 2.10.4SDK
>
>         Attachments: UIMA-5961.diff
>
>
> localized message does not work in the case of pears. The classloader stored 
> in the internationalizedException is wrong. The bundle cant be found in this 
> classloader.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to