Application seeing messages.properties from Eclipse Yasson in the classpath instead of the application messages.properties in JBoss EAP 7.2

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7.2

Issue

  • Application seeing messages.properties from Eclipse Yasson in the classpath instead of the application messages.properties in JBoss EAP 7.2

ResourceBundle and Spring Web Message tag not finding property that exists in the classpath with:

Caused by: javax.servlet.jsp.JspTagException: No message found under code 'My.Property' for locale 'en'.
	at org.springframework.web.servlet.tags.MessageTag.doEndTag(MessageTag.java:200)

Resolution

Apply CP1 or later when available.

Workaround:

Exclude the org.eclipse.yasson module using jboss-deployment-structure.xml in the application such as:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<exclusions>
<module name="org.eclipse.yasson"/>
</exclusions>
</deployment>
</jboss-deployment-structure>

Or rename the messages.properties in the application or move it into a package so that it is not in the root.

Root Cause

Content from issues.jboss.org is not included.JBEAP-16618 - EE deployer adding dependency on org.eclipse.yasson which exposes messages.properties to deployments

The org.eclipse.yasson module has a messages.properties in the root which is getting picked up by the application.

Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.