<div dir="ltr">I&#39;m trying to have CDI and OSGi work well together and I&#39;m trying to deploy DeltaSpike in OSGi.<div>Doing so, I&#39;m hitting <a href="https://issues.jboss.org/browse/WELD-1309" target="_blank">https://issues.jboss.org/browse/WELD-1309</a></div>

<div>I wonder if any of the CDI / OSGi guys around have already thought about the problem.</div><div><br></div><div>So sum up, the problem is how to package / use CDI extensions in OSGi.   DeltaSpike provide some bundles which can be deployed, but they don&#39;t work well in OSGi.   The reason is that a lot of the CDI stuff assume a flat classloader.  The Weld-Osgi project tries to make that work better but there are still problems:</div>

<div>  * extension discovery: atm, the META-INF/services declaration for extensions are only found in the bundle, not in other bundles</div><div>  * only classes from the bundle are considered as beans, not classes that may be part of the extension</div>

<div><br></div><div>I would think, we want extensions to be specifically declared for a given bundle : we need to know for a given bundle which extensions should be loaded.  I&#39;ve trying so far by doing discovery of beans and extensions using the bundle classloader and the classloaders of required bundles.   It seems to work, but I&#39;m not really sure it&#39;s the way to go, especially I&#39;m not sure that all beans defined by a bundle which is an extension should be added to the bundle using that extension (the extension being itself a bundle can already have its own CDI container).</div>
<div><br></div><div style>Thoughts ?</div><div><br clear="all"><div><br></div>-- <br>
------------------------<br>Guillaume Nodet<br>------------------------<br>Blog: <a href="http://gnodet.blogspot.com/" target="_blank">http://gnodet.blogspot.com/</a><br>------------------------<br>FuseSource, Integration everywhere<br>

<a href="http://fusesource.com" target="_blank">http://fusesource.com</a>
</div></div>