struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <>
Subject [jira] [Commented] (WW-4943) opensymphony.xwork2.util.LocalizedTextUtil can't get i18n resources
Date Thu, 03 Jan 2019 18:52:00 GMT


Lukasz Lenart commented on WW-4943:

I was trying to figure how does it supposed to work, but after spending some time on that
I cannot find a real use case. I have no idea how parent-child class loader hierarchy can
influence this code - it was refactored btw.

Please try to use the latest version and report if this is still an issue.

> opensymphony.xwork2.util.LocalizedTextUtil can't get i18n resources
> -------------------------------------------------------------------
>                 Key: WW-4943
>                 URL:
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Integration
>    Affects Versions: 2.3.34
>            Reporter: Linus Yan
>            Priority: Critical
>             Fix For: 2.6
> This problem is caused by the cache mechanism of i18 resources. In findDefaultText()
method, it used the ClassLoader  hashcode as the key. But it forget the child-parent hierarchy.
In some framework, they will create new ClassLoader as the WebappClassLoader children. In
such case,it's impossible to find the i18 resources for them.
> Source code in LocalizedTextUtil.findDefaultText:
> List<String> localList = classLoaderMap.get(Thread.currentThread().getContextClassLoader().hashCode());

This message was sent by Atlassian JIRA

View raw message