<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><a href="https://hibernate.atlassian.net/browse/BVAL-200" class="">https://hibernate.atlassian.net/browse/BVAL-200</a><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 20 Mar 2017, at 04:34, Gunnar Morling &lt;gunnar@hibernate.org&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi,<div class=""><br class=""></div><div class="">Thanks for bringing up this issue, Nathan.</div><div class=""><br class=""></div><div class="">The Bean Validation spec expects the file to be at META-INF/validation.xml, no matter what type of application it is. I'll need to dig a bit deeper why the platform spec mentions WEB-INF/validation.xml.</div><div class=""><br class=""></div><div class="">&gt;&nbsp;<span style="font-size:12.8px" class="">the TCK uses the WEB-INF/validation.xml location</span><br class=""></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">Do you have a pointer to this usage? Please send it to me off-list if it's somewhere within the EE TCK. The BV TCK itself uses META-INF/validation.xml.</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class="">&gt;&nbsp;<span style="font-size:12.8px" class="">Therefore, I'd expect a lot of users in the field to be using the WEB-INF location</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">I just tried WEB-INF/validation.xml in a plain WAR as well as a WAR within an EAR, and it wouldn't be applied either way (testing the BV reference implementation). Do you have a test case which shows successful usage of WEB-INF/validation.xml?</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">&gt;&nbsp;</span><span style="font-size:12.8px" class="">Otherwise, the JavaEE Platform spec could be changed to no longer state WEB-INF/validation.xml</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">My current inclination is to suggest exactly that to the Java EE leads, as it seems like a glitch and I can't see how it'd ever work with the RI. B</span><span style="font-size:12.8px" class="">ut I'll synch with Emmanuel (former BV lead) to make sure I'm not missing a piece.</span></div><div class=""><br class=""></div><div class="">@Marco,</div><div class=""><br class=""></div><div class=""><span style="font-size:12.8px" class="">&gt; The implementation of 'WEB-INF/validation.xml' for the web components and its&nbsp;</span></div><div class=""><span style="font-size:12.8px" class="">&gt; integration with Bean Validation is the full responsibility (EE.5.16.2) of the Java EE&nbsp;</span></div><div class=""><span style="font-size:12.8px" class="">&gt; Product Provider that declares it&nbsp;</span><br class=""></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">You seem to suggest that a container somehow may make it that WEB-INF/validation.xml is exposed as META-INF/validation.xml to the BV provider. That may theoretically be doable, but I don't think it's intended or suggested by the EE spec.</span></div><div class=""><span style="font-size:12.8px" class=""><br class=""></span></div><div class=""><span style="font-size:12.8px" class="">Specifically, section EE.5.16 deals with the "application client container" property which the container must set depending on where this app is running (ACC vs. web/EJB container). It's not related to the retrieval of BV deployment descriptors.</span></div><div class=""><br class=""></div><div class="">--Gunnar</div><div class=""><br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2017-03-17 20:03 GMT+01:00 Marco Molteni <span dir="ltr" class="">&lt;<a href="mailto:moltenma@gmail.com" target="_blank" class="">moltenma@gmail.com</a>&gt;</span>:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">Hi Nathan,</div><div class=""><div class=""><br class=""></div><div class="">I agree that can be confusing for the developers that read the two documents but the specification of BV is, IMHO, consistent:</div><div class=""><br class=""></div><div class="">1.2. Specification Goals: &nbsp;'The validation API developed by this JSR is not intended for use in any one tier or programming model. It is specifically not tied to either the web tier or the persistence tier'.</div></div><div class=""><br class=""></div><div class="">And the JavaEE spec version 7 (and 8) :</div><div class=""><div class="">'EE.5.16.2 Java EE Product Provider’s Responsibilities</div><div class="">The Java EE Product Provider is responsible for providing the correct application client container property as required by this specification.'</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">'EE.5.17.1 Application Component Provider’s Responsibilities</div><div class="">[...] The Application Component Provider may customize the ValidatorFactory and (indirectly) Validator instances by including a Bean Validation deployment descriptor inside a specific module of the application.'</div></div><div class=""><br class=""></div><div class=""><div class="">'EE.5.17.2 Java EE Product Provider’s Responsibilities</div><div class="">[...] These objects must be used to configure the default ValidatorFactory available at java:comp/ValidatorFactory in accordance with the bootstrapping APIs described by the Bean Validation specification. [...]'</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">The implementation of 'WEB-INF/validation.xml' for the web components and its integration with Bean Validation is the full responsibility (EE.5.16.2) of the Java EE Product Provider that declares it .</div><div class="">The Bean Validation doesn't have to worry (or know) about the existence of a web component or a web configuration directory, it's out of its scope.</div><div class="">The correct configuration and communication between these (Web and BC) and other components is regulated by the container (EE.2.4).</div><div class=""><br class=""></div><div class="">The documents are (maybe) confusing but correct, in my opinion.</div><div class=""><br class=""></div><div class="">Regards</div><div class=""><br class=""></div><div class="">Marco</div><div class="">&nbsp;</div><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="gmail-m_-3142183346763634370m_4431824595843352676h5"><div class="">Am 15.03.2017 um 17:39 schrieb Nathan Mittlestat &lt;<a href="mailto:nmittles@gmail.com" target="_blank" class="">nmittles@gmail.com</a>&gt;:</div><br class="gmail-m_-3142183346763634370m_4431824595843352676m_-7451719855524532266Apple-interchange-newline"></div></div><div class=""><div class=""><div class="gmail-m_-3142183346763634370m_4431824595843352676h5"><div dir="ltr" class=""><div class="">Hi All,<br class=""></div><div class=""><br class="">One area I'd like to see a clarification 
on in the spec is around the location of the validation.xml in a JavaEE 
web container environment.&nbsp; The Bean Validation spec indicates the 
validation.xml is always at META-INF/validation.xml.&nbsp; The JavaEE 
Platform spec states WEB-INF/validation.xml should be used for web 
modules. The entire Bean Validation spec has no mention of web modules, 
and seems to mainly focus on JavaSE.&nbsp; However, it does mention 
integration points such as CDI and JAX-RS, so I don't think it would be 
out of line to clarify in the Bean Validation spec for web modules.&nbsp; 
Otherwise, the JavaEE Platform spec could be changed to no longer state 
WEB-INF/validation.xml, but previous JavaEE versions already include 
this, and the TCK uses the WEB-INF/validation.xml location. Therefore, 
I'd expect a lot of users in the field to be using the WEB-INF location.<br class=""><br class="">The Bean Validation spec has the following section (page 206):<br class="">Unless explicitly ignored by calling Configuration.ignoreXMLConfigu<wbr class="">ration(), a Configuration takes into<br class="">account the configuration available in META-INF/validation.xml. This configuration file is optional but<br class="">can be used by applications to refine some of the Bean Validation behavior. If more than one META-<br class="">INF/validation.xml file is found in the classpath, a ValidationException is raised.<br class=""><br class="">In contrasts the JavaEE Platform spec has (page 127 of JavaEE 7):<br class="">In order to customize the returned ValidatorFactory, an EJB, web or<br class="">application client module may specify a Bean Validation XML deployment<br class="">descriptor. The name of the descriptor is WEB-INF/validation.xml for web<br class="">modules and META-INF/validation.xml for all other types of modules.<div class="gmail-m_-3142183346763634370m_4431824595843352676m_-7451719855524532266gmail-yj6qo gmail-m_-3142183346763634370m_4431824595843352676m_-7451719855524532266gmail-ajU"><div class="gmail-m_-3142183346763634370m_4431824595843352676m_-7451719855524532266gmail-ajR" id="gmail-m_-3142183346763634370m_4431824595843352676m_-7451719855524532266gmail-:qh"><img class="gmail-m_-3142183346763634370m_4431824595843352676m_-7451719855524532266gmail-ajT"></div></div><span class="gmail-m_-3142183346763634370m_4431824595843352676m_-7451719855524532266gmail-adL gmail-m_-3142183346763634370m_4431824595843352676m_-7451719855524532266gmail-HOEnZb"><font color="#888888" class=""><br class=""><br class=""><br class=""></font></span></div><span class="gmail-m_-3142183346763634370m_4431824595843352676m_-7451719855524532266gmail-adL gmail-m_-3142183346763634370m_4431824595843352676m_-7451719855524532266gmail-HOEnZb"><font color="#888888" class="">--Nathan</font></span></div></div></div>
______________________________<wbr class="">_________________<br class="">beanvalidation-dev mailing list<br class=""><a href="mailto:beanvalidation-dev@lists.jboss.org" target="_blank" class="">beanvalidation-dev@lists.jboss<wbr class="">.org</a><br class=""><a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank" class="">https://lists.jboss.org/mailma<wbr class="">n/listinfo/beanvalidation-dev</a></div></blockquote></div><br class=""></div><br class="">______________________________<wbr class="">_________________<br class="">
beanvalidation-dev mailing list<br class="">
<a href="mailto:beanvalidation-dev@lists.jboss.org" target="_blank" class="">beanvalidation-dev@lists.jboss<wbr class="">.org</a><br class="">
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank" class="">https://lists.jboss.org/mailma<wbr class="">n/listinfo/beanvalidation-dev</a><br class=""></blockquote></div><br class=""></div></div>
_______________________________________________<br class="">beanvalidation-dev mailing list<br class="">beanvalidation-dev@lists.jboss.org<br class="">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</div></blockquote></div><br class=""></div></body></html>