[
https://issues.apache.org/jira/browse/DELTASPIKE-866?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Erik-Berndt Scheper resolved DELTASPIKE-866.
--------------------------------------------
Resolution: Invalid
Sorry for the noise; I have closed my own issue as invalid. The NPE was
produced by a null locale; and the DefaultMessageResolver *does* take the
MessageBuncleContext into account, only *after* the original bundle and not
*before* as I assumed.
> MessageBundleInvocationHandler does not take messageSource value of
> @MessageContextConfig into account
> ------------------------------------------------------------------------------------------------------
>
> Key: DELTASPIKE-866
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-866
> Project: DeltaSpike
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.3.0
> Reporter: Erik-Berndt Scheper
>
> Assume the following message bundle interface :
> {code}
> @MessageBundle
> @MessageContextConfig(messageSource = {"com.myapp.bundle.Bundle"})
> public interface CoreBundleMessages {
> @MessageTemplate(value = "{common.meta.today}") String
> getCommonMetaToday();
> }
> {code}
> If I inject this bundle without defining a "CoreBundleMessages" properties
> file , the message source "com.myapp.bundle.Bundle" is never read by the
> o.a.deltaspike.core.impl.message.MessageBundleInvocationHandler class.
> The annotation is read successfully by the code
> {code}
> if (messageContextConfig != null)
> {
> applyMessageContextConfig(messageContext,
> messageContextConfig);
> }
> {code}
> but subsequently the actual messagebundle is determined as follows:
> {code}
> String messageBundleName = method.getDeclaringClass().getName();
> {code}
> IMHO The message bundle name from the MessageContextConfig should take
> precedence.
> Eventually this leads to
> {noformat}
> java.lang.NullPointerException
> at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1317)
> [rt.jar:1.8.0_40]
> at java.util.ResourceBundle.getBundle(ResourceBundle.java:1082)
> [rt.jar:1.8.0_40]
> at
> org.apache.deltaspike.core.util.PropertyFileUtils.getResourceBundle(PropertyFileUtils.java:107)
> [deltaspike-core-api-1.3.0.jar:1.3.0]
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)