My ultimate goal is to use Apache ACE to provision configuration for ds components.
The constraints are:
- ACE requires the metatype xml file to be deployed as a separate artifact from the bundle it corresponds to
- As far as I can tell, the Felix container I'm provisioning to doesn't recognize the metatype and associate it to the ds component unless it's inside the bundle
The solution suggested on the ACE mailing list was to split up the metatype definition into two separate files, the <OCD> portion inside the OSGI-INF/metatype directory in the bundle, and the <Designate> portion as a separate artifact handled by ACE. According to them, the OSGi spec supports this separation.
I'm running into issues deploying the configuration in this way, and I'm still trying to isolate where the error is coming from. I think one of the possibilities is that since the metatype xml generated by bnd inside the bundle already has a <Designate> element, the separate one I'm provisioning with ACE doesn't get picked up. Unfortunately, I can't test this theory because I don't know how to instruct bnd to generate only the <OCD> element of the metatype file.
I'm using bndtools 2.4.1.REL-20150116-150145-g75d944b
Here is the error I get when deploying:
[ERROR] 07:25:19 (controller) Installation of deployment update failed: Error while processing resource 'com.patronpath.ring.cc.decryptor.CreditCardDecryptorImpl.Config_ring-ace-agent-test_68.0.0.xml' (463)!
INFO|3647/0|yajsw|15-04-13 07:25:19|org.osgi.service.deploymentadmin.spi.ResourceProcessorException: No Object Class Definition found with id=com.patronpath.ring.cc.decryptor.CreditCardDecryptorImpl
INFO|3647/0|yajsw|15-04-13 07:25:19| at org.apache.felix.deployment.rp.autoconf.AutoConfResourceProcessor.process(AutoConfResourceProcessor.java:174)
INFO|3647/0|yajsw|15-04-13 07:25:19| at org.apache.felix.deploymentadmin.spi.ProcessResourceCommand.doExecute(ProcessResourceCommand.java:100)
INFO|3647/0|yajsw|15-04-13 07:25:19| at org.apache.felix.deploymentadmin.spi.Command.execute(Command.java:55)
where 'com.patronpath.ring.cc.decryptor.CreditCardDecryptorImpl.Config_ring-ace-agent-test_68.0.0.xml' is:
<?xml version='1.0'?>
localization="com.patronpath.ring.cc.decryptor.CreditCardDecryptorImpl$Config">
<Designate pid="com.patronpath.ring.cc.decryptor.CreditCardDecryptorImpl"
bundle="osgi-dp:com.patronpath.ring.cc.decryptor">
<Object ocdref="com.patronpath.ring.cc.decryptor.CreditCardDecryptorImpl">
<Attribute adref="creditCardDecryptionKey" content="${context.creditCardDecryptionKey}" />
</Object>
</Designate>
</metatype:MetaData>
Any guidance on how to prevent bnd from generating the <Designate> element or other approaches to debug this are much appreciated.
Robert