Thanks for the link.<div><br></div><div>--Kevin<br><br><div class="gmail_quote">On 9 January 2012 16:02, Jagadish Prasath Ramu <span dir="ltr">&lt;<a href="mailto:jagadish.ramu@oracle.com">jagadish.ramu@oracle.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Emmanuel, Kevin :<br>
<br>
Please find a reference on defining OSGi header and version numbers in<br>
the manifest file of api .jars.<br>
<br>
<a href="https://wikis.oracle.com/display/GlassFish/Maven+Versioning+Rules" target="_blank">https://wikis.oracle.com/display/GlassFish/Maven+Versioning+Rules</a><br>
<br>
Thanks,<br>
-Jagadish<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, 2012-01-02 at 17:47 +0100, Emmanuel Bernard wrote:<br>
&gt; Sorry for the long slack off.<br>
&gt;<br>
&gt;<br>
&gt; OSGi is generally not my field but here are a few comments on what<br>
&gt; Gunnar and Kevin have said:<br>
&gt;<br>
&gt;<br>
&gt; - we can definitely experiment with Hibernate Validator and offer some<br>
&gt; OOTB support for OSGi and other modularity solutions.<br>
&gt; - we can consider the API JAR provided by the RI team and add the OSGi<br>
&gt; headers if that&#39;s the correct solution but I don&#39;t feel like adding<br>
&gt; them in the spec document proper<br>
&gt; - we should align with what the CDI group does wrt OSGi headers<br>
&gt; especially since CDI will be an optional dependency of BV<br>
&gt; - can someone flesh out a more concrete proposal and push it<br>
&gt; to <a href="http://beanvalidation.org/proposals/BVAL-251" target="_blank">http://beanvalidation.org/proposals/BVAL-251</a> ? Kevin do you want to<br>
&gt; take the lead?<br>
&gt;<br>
&gt;<br>
&gt; Emmanuel<br>
&gt;<br>
&gt; On 3 nov. 2011, at 12:13, Kevin Pollet wrote:<br>
&gt;<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; On 1 November 2011 15:36, Emmanuel Bernard &lt;<a href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt;         Two points.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;         CDI will be a dependency of Bean Validation (see topic on<br>
&gt; &gt;         injection).<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;         What does not work today in the following code in a modular<br>
&gt; &gt;         environment?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;         Validation<br>
&gt; &gt;             .byDefaultProvider()<br>
&gt; &gt;                 .providerResolver( myOSGiResolver )<br>
&gt; &gt;              .configure()<br>
&gt; &gt;              .buildValidatorFactory();<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; The dependency to CDI will be optional, right?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; In this case that dependency should be declared as optional in the<br>
&gt; &gt; OSGi headers. By doing that, if CDI cannot be used in an OSGI<br>
&gt; &gt; environment this will not affect BV.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; AFAIK, the following things doesn&#39;t work with that approach (not<br>
&gt; &gt; exhaustive):<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; * loading of validation and constraint mapping files<br>
&gt; &gt; * loading of ValidationMessages.properties<br>
&gt; &gt; * I&#39;ve not tested it but I think the loading of the class specified<br>
&gt; &gt; in the xml files doesn&#39;t work<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; The problem here is that the implementation use the TCCL or the<br>
&gt; &gt; classloader of one of its class to load resources or classes. That<br>
&gt; &gt; approach cannot work in a modular environment. For example in OSGi<br>
&gt; &gt; the TCCL is not set to the right classloader and the implementation<br>
&gt; &gt; classloader can&#39;t access another bundle resources or classes (if<br>
&gt; &gt; they are not imported).<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; IMHO, BV should specify a mechanism used by implementations to load<br>
&gt; &gt; resources and classes. The default implementation should work out of<br>
&gt; &gt; the box in Java EE and this mechanism can be customized by users<br>
&gt; &gt; which want to work in a modular environement.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Maybe an implementation of such mechanism can be provided for OSGi<br>
&gt; &gt; or JBoss modules by the RI?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; WDYT?<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; --Kevin<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;         On 31 oct. 2011, at 17:13, Gunnar Morling<br>
&gt; &gt;         &lt;<a href="mailto:gunnar.morling@googlemail.com">gunnar.morling@googlemail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;         &gt; &gt; So all JARs must be OSGi-ified before they can be used?<br>
&gt; &gt;         &gt; &gt; [...]<br>
&gt; &gt;         &gt; &gt; I&#39;m asking because declaring dependencies means that all<br>
&gt; &gt;         &gt; &gt; dependent JSRs (and<br>
&gt; &gt;         &gt; &gt; the JDK) will need to be OSGi-ified as well. I&#39;d rather<br>
&gt; &gt;         &gt; &gt; see that coordinated<br>
&gt; &gt;         &gt; &gt; by the Java EE expert group.<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; In case of BV we would have to add the OSGi headers to the<br>
&gt; &gt;         &gt; JAR to make<br>
&gt; &gt;         &gt; it usable under OSGi. As Kevin says there is no relation<br>
&gt; &gt;         &gt; to the JDK<br>
&gt; &gt;         &gt; here, and AFAIK the BV API doesn&#39;t have any other<br>
&gt; &gt;         &gt; additional<br>
&gt; &gt;         &gt; dependencies. So adding these headers wouldn&#39;t be a<br>
&gt; &gt;         &gt; problem IMO (each<br>
&gt; &gt;         &gt; OSGi bundle is still a standard JAR which can be used in<br>
&gt; &gt;         &gt; any other<br>
&gt; &gt;         &gt; environment).<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; Another thing is the bootstrapping, i.e. how BV<br>
&gt; &gt;         &gt; implementations are<br>
&gt; &gt;         &gt; found. Searching for resources such as<br>
&gt; &gt;         &gt; META-INF/services/j.v.ValidationProvider doesn&#39;t work in<br>
&gt; &gt;         &gt; OSGi (I don&#39;t<br>
&gt; &gt;         &gt; know about JBoss modules). This kind of things is in OSGi<br>
&gt; &gt;         &gt; typically<br>
&gt; &gt;         &gt; solved using services, that means in the BV bundle would<br>
&gt; &gt;         &gt; be the<br>
&gt; &gt;         &gt; definition of a service interface (we already have this<br>
&gt; &gt;         &gt; with<br>
&gt; &gt;         &gt; ValidationProvider) while BV providers would register<br>
&gt; &gt;         &gt; implementations<br>
&gt; &gt;         &gt; of this service. In the BV API Jar we still would need<br>
&gt; &gt;         &gt; some glue<br>
&gt; &gt;         &gt; code/meta-data to obtain references to these<br>
&gt; &gt;         &gt; implementations.<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; Personally I feel adding the headers would be ok for the<br>
&gt; &gt;         &gt; &quot;official&quot;<br>
&gt; &gt;         &gt; API Jar as it&#39;s rather un-intrusive, but the bootstrapping<br>
&gt; &gt;         &gt; stuff might<br>
&gt; &gt;         &gt; be too much. One idea might be to provide separate<br>
&gt; &gt;         &gt; &quot;enabler&quot; modules<br>
&gt; &gt;         &gt; for the different module systems around, e.g. there could<br>
&gt; &gt;         &gt; be a<br>
&gt; &gt;         &gt; bv-osgi.jar which takes the raw API jar and makes it<br>
&gt; &gt;         &gt; usable under OSGi<br>
&gt; &gt;         &gt; (it could also offer j.v.Validator as OSGi service etc.).<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; --Gunnar<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; 2011/10/28 Emmanuel Bernard &lt;<a href="mailto:emmanuel@hibernate.org">emmanuel@hibernate.org</a>&gt;:<br>
&gt; &gt;         &gt; &gt; So all JARs must be OSGi-ified before they can be used?<br>
&gt; &gt;         &gt; &gt; Is there any way to<br>
&gt; &gt;         &gt; &gt; keep this information outside? Do you know of any other<br>
&gt; &gt;         &gt; &gt; JSR published JAR<br>
&gt; &gt;         &gt; &gt; that also expose its OSGi headers?<br>
&gt; &gt;         &gt; &gt; I&#39;m asking because declaring dependencies means that all<br>
&gt; &gt;         &gt; &gt; dependent JSRs (and<br>
&gt; &gt;         &gt; &gt; the JDK) will need to be OSGi-ified as well. I&#39;d rather<br>
&gt; &gt;         &gt; &gt; see that coordinated<br>
&gt; &gt;         &gt; &gt; by the Java EE expert group. There is also the problem<br>
&gt; &gt;         &gt; &gt; of supporting them<br>
&gt; &gt;         &gt; &gt; forever(tm).<br>
&gt; &gt;         &gt; &gt; On 27 oct. 2011, at 22:52, Kevin Pollet wrote:<br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt; Hi experts,<br>
&gt; &gt;         &gt; &gt; IMHO, making Bean Validation ready for the modular world<br>
&gt; &gt;         &gt; &gt; is a great thing!<br>
&gt; &gt;         &gt; &gt; A first step might be to provide the module meta-datas<br>
&gt; &gt;         &gt; &gt; (OSGi headers,<br>
&gt; &gt;         &gt; &gt; …). For OSGi, those meta-datas can be added to the jar<br>
&gt; &gt;         &gt; &gt; Manifest within the<br>
&gt; &gt;         &gt; &gt; maven build with the maven-bundle-plugin. The advantage<br>
&gt; &gt;         &gt; &gt; is that the api can<br>
&gt; &gt;         &gt; &gt; be deployed in an OSGi container out of the box. For<br>
&gt; &gt;         &gt; &gt; JBoss Modules the<br>
&gt; &gt;         &gt; &gt; descriptor reside alongside its content but we can<br>
&gt; &gt;         &gt; &gt; provide it.<br>
&gt; &gt;         &gt; &gt; WDYT?<br>
&gt; &gt;         &gt; &gt; --Kevin<br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt; _______________________________________________<br>
&gt; &gt;         &gt; &gt; beanvalidation-dev mailing list<br>
&gt; &gt;         &gt; &gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
&gt; &gt;         &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt; _______________________________________________<br>
&gt; &gt;         &gt; &gt; beanvalidation-dev mailing list<br>
&gt; &gt;         &gt; &gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
&gt; &gt;         &gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt; &gt;<br>
&gt; &gt;         &gt;<br>
&gt; &gt;         &gt; _______________________________________________<br>
&gt; &gt;         &gt; beanvalidation-dev mailing list<br>
&gt; &gt;         &gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
&gt; &gt;         &gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
&gt; &gt;         &gt;<br>
&gt; &gt;<br>
&gt; &gt;         _______________________________________________<br>
&gt; &gt;         beanvalidation-dev mailing list<br>
&gt; &gt;         <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
&gt; &gt;         <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; beanvalidation-dev mailing list<br>
&gt; &gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; beanvalidation-dev mailing list<br>
&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
<br>
<br>
<br>
_______________________________________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/beanvalidation-dev</a><br>
</div></div></blockquote></div><br></div>