<div dir="ltr">Hi Paul<div><br></div><div>As we discussed on IRC yesterday, our plan is to support multiple CacheManagers using the same JGroups transport with FORK. If each deployment has its own CacheManager, there&#39;s no need for a cache-specific classloader.</div>

<div><br></div><div>That being said, ISPN-4639 and ISPN-3979 are indeed bugs and we should fix them for Beta2.</div><div><br></div><div>Cheers</div><div>Dan<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 13, 2014 at 6:29 PM, Paul Ferraro <span dir="ltr">&lt;<a href="mailto:paul.ferraro@redhat.com" target="_blank">paul.ferraro@redhat.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It seems that the ability to associate a cache with a specific classloader has been removed in 7.0 by this commit:<br>


<a href="https://github.com/infinispan/infinispan/commit/39a21a025db2e0f85019b93d09052b4772abbaa8" target="_blank">https://github.com/infinispan/infinispan/commit/39a21a025db2e0f85019b93d09052b4772abbaa8</a><br>
<br>
I don&#39;t fully understand the reason for the removal. WildFly previously relied on this mechanism to define the classloader from which Infinispan should load any classes when building its configuration.  In general, WF builds its configuration using object instances instead of class names, so normally this isn&#39;t a problem.  However, there isn&#39;t always such a mechanism (e.g. <a href="https://issues.jboss.org/browse/ISPN-3979" target="_blank">https://issues.jboss.org/browse/ISPN-3979</a>)<br>



<br>
However, now that ConfigurationBuilder.classloader(...) is gone, the classloader used to build a Configuration is effectively hardcoded (usually as this.getClass().getClassLoader()).<br>
<br>
This directly affects the ability for a WildFly using to configure a cache with querying.  IndexingConfigurationBuilder.validate(...) previously used the configured classloader to validate that the query module is loadable.<br>



<br>
<a href="https://github.com/infinispan/infinispan/blob/6.0.x/core/src/main/java/org/infinispan/configuration/cache/IndexingConfigurationBuilder.java#L141" target="_blank">https://github.com/infinispan/infinispan/blob/6.0.x/core/src/main/java/org/infinispan/configuration/cache/IndexingConfigurationBuilder.java#L141</a><br>



<br>
However, this is now hardcoded to use the classloader that loaded the IndexingConfigurationBuilder class itself.<br>
<br>
<a href="https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/configuration/cache/IndexingConfigurationBuilder.java#L183" target="_blank">https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/configuration/cache/IndexingConfigurationBuilder.java#L183</a><br>



<br>
The WF distribution uses distinct modules for infinispan-core vs infinispan-query.  Consequently, if your cache don&#39;t need querying, the query module is not loaded.  WF8 let the user configure a cache with query support via &lt;distributed-cache ... module=&quot;org.infinispan.query&quot;/&gt;.<br>



<br>
Currently, however, the only way we can satisfy the validation logic in IndexingConfigurationBuilder.validate(...) is to bloat our core &quot;org.infinispan&quot; module with the infinispan-query module and its dependencies.  I don&#39;t want to do that.  Is there some way we can re-enable the ability to configure a cache with a classloader that still satisfies the reasons for its original removal? GlobalConfigurationBuilder still supports the ability to configure a classloader, why remove this from ConfigurationBuilder?<br>



<br>
That said, however, the IndexingConfigurationBuilder validation itself is wrong.  Ultimately, the infinispan-query module will be loaded by the classloader with which the GlobalConfiguration was built (i.e. the default classloader of the cache), so really, at the very least, the validation logic in IndexingConfigurationBuilder.validate(...) should reflect this.  I&#39;ve opened <a href="https://issues.jboss.org/browse/ISPN-4639" target="_blank">https://issues.jboss.org/browse/ISPN-4639</a> to track this specific bug.<br>



<br>
Thoughts?<br>
_______________________________________________<br>
infinispan-dev mailing list<br>
<a href="mailto:infinispan-dev@lists.jboss.org" target="_blank">infinispan-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br>
</blockquote></div><br></div></div></div>