You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bean Validation can have XML configuration files that reference javax.validation.constraints.* constraint classes. These XML files are references from the main bean validation deployment descriptor named validation.xml.
The transformer tool needs to be updated to:
locate the bean validation validation.xml deployment descriptors
WEB-INF/classes/META-INF/validation.xml (war module location where META-INF/validation.xml is available from the classloader)
WEB-INF/validation.xml (non-spec, but Liberty supported war module location)
META-INF/validation.xml (ear and jar location where META-INF/validation.xml is available from the classloader))
scan the validation.xml for <constraint-mapping> tags
load the xml file(s) referenced by the <constraint-mapping> tag(s)
update any references to javax.validation.constraints.* in these xml contraint mapping files
For Testing:
From com.ibm.ws.beanvalidation.v11_fat/fat/src/com/ibm/ws/beanvalidation/fat/basic/BasicValidation_Common.java remove:
if (JakartaEE9Action.isActive()) {
beanvalidation_10War.move("/WEB-INF/constraints-house_EE9.xml", "/WEB-INF/constraints-house.xml");
beanvalidation_11War.move("/WEB-INF/constraints-house_EE9.xml", "/WEB-INF/constraints-house.xml");
}
From /com.ibm.ws.beanvalidation.v11_fat/fat/src/com/ibm/ws/beanvalidation/fat/ejb/EJBModule_Common.java remove:
if (JakartaEE9Action.isActive()) {
jar.move("/META-INF/constraints-house_EE9.xml", "/META-INF/constraints-house.xml");
jar2.move("/META-INF/constraints-house_EE9.xml", "/META-INF/constraints-house.xml");
}
Delete the no longer needed constraints-house_EE9.xml files from both applications.
Example validation.xml:
<?xml version="1.0" encoding="UTF-8"?>
<validation-configxmlns="http://jboss.org/xml/ns/javax/validation/configuration"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.1.xsd"version="1.1">
<message-interpolator>beanvalidation11.CustomMessageInterpolator</message-interpolator>
<traversable-resolver>beanvalidation11.CustomTraversableResolver</traversable-resolver>
<constraint-validator-factory>beanvalidation11.CustomConstraintValidatorFactory</constraint-validator-factory>
<!-- new in Bean Validation 1.1 -->
<parameter-name-provider>beanvalidation11.CustomParameterNameProvider</parameter-name-provider>
<constraint-mapping>WEB-INF/constraints-house.xml</constraint-mapping>
</validation-config>
Example constraint mapping xml. In this case the file is named constraints-house.xml:
tbitonti
changed the title
Jakarta Transformer Tool: Support updating bean validation constraint mappings.
JakartaEE: Transformer: Support updating bean validation constraint mappings.
Oct 7, 2021
Bean Validation can have XML configuration files that reference
javax.validation.constraints.*
constraint classes. These XML files are references from the main bean validation deployment descriptor namedvalidation.xml
.The transformer tool needs to be updated to:
validation.xml
deployment descriptorsvalidation.xml
for<constraint-mapping>
tags<constraint-mapping>
tag(s)javax.validation.constraints.*
in these xml contraint mapping filesFor Testing:
From
com.ibm.ws.beanvalidation.v11_fat/fat/src/com/ibm/ws/beanvalidation/fat/basic/BasicValidation_Common.java
remove:From
/com.ibm.ws.beanvalidation.v11_fat/fat/src/com/ibm/ws/beanvalidation/fat/ejb/EJBModule_Common.java
remove:Delete the no longer needed
constraints-house_EE9.xml
files from both applications.Example validation.xml:
Example constraint mapping xml. In this case the file is named
constraints-house.xml
:The text was updated successfully, but these errors were encountered: