Activating both Weld-OSGi and the Weld Subsystem in Wildfly 8 Alpha 3
ampie Jul 30, 2013 8:09 AMI have checked out the weld-osgi-2.x branch and the latest jbosgi wildfly patch, and I then patched my Wildfly 8 Alpha 3 installation. I had an existing POC which I have now successfully ported to these versions, and it works as it did before. I just had to tweak the bnd file in the weld-osgi-core-mandatory project a bit. Great stuff, I like this product a lot, keep up the good work!
My only concern currently is that I had to deactivate the Weld subsytem in Wildfly, as it kept interfering with Weld-OSGi. I suspect it may have to do with the way I have my capabilities configured in JBoss OSGi, which is as follows:
<capability name="javax.jws.api" /> | ||||
<capability name="javax.interceptor.api" /> | ||||
<capability name="javax.persistence.api" /> | ||||
<capability name="javax.servlet.api" /> | ||||
<capability name="javax.transaction.api" /> | ||||
<capability name="org.apache.felix.log" startlevel="1" /> | ||||
<capability name="org.jboss.osgi.logging" startlevel="1" /> | ||||
<capability name="org.apache.felix.configadmin" startlevel="1" /> | ||||
<capability name="org.jboss.as.osgi.configadmin" startlevel="1" /> | ||||
<capability name="org.jboss.as.osgi.http" startlevel="1" /> | ||||
<capability name="org.jboss.as.osgi.jpa" startlevel="1" /> | ||||
<capability name="org.jboss.weld.osgi:weld-osgi-core-mandatory:2.1-SNAPSHOT" startlevel="1" /> | ||||
<capability name="org.jboss.weld.osgi:weld-osgi-core-api:2.1-SNAPSHOT" startlevel="2" /> | ||||
<capability name="org.jboss.weld.osgi:weld-osgi-core-extension:2.1-SNAPSHOT" startlevel="3" /> | ||||
<capability name="org.jboss.weld.osgi:weld-osgi-core-integration:2.1-SNAPSHOT" startlevel="2" /> | ||||
<capability name="org.jboss.weld.osgi:weld-osgi-core-spi:2.1-SNAPSHOT" startlevel="2" /> |
To me this seemed a bit like a sledge hammer approach, because almost all of the classes in weld-osgi-core-mandatory,weld-osgi-core-api and weld-osgi-core-spi are already available as modules, and I have updated the modules to the correct version of Weld. So when I activate the Weld subsystem, it complains about the hibernate validator not implementing Extension which indicates that it has been loaded from a different classloader, in this case the OSGi bundle's own class loader. This therefore does not seem like the correct approach.
What is the correct way of activating Weld-OSGi on top of JBoss OSGi? Is there a way around the conflict with the Wildfly Weld subsystem? If it is simply a case of figuring out how to package the weld-osgi bundles for Wildfly, maybe I can help, submit a patch or something. But I suspect it may be more than just that?
Any input would be much appreciated!
Ampie