Hello John, On Jan 28, 2010, at 3:15 , John E. Conlon wrote: >>>> Autoconf files (or any other artifact that is not a bundle) are not yet >>>> supported. >>>> That is, the client (the bundles that know how to communicate with the >>>> server) supports this, but the web ui does not show these features yet. >>>> https://issues.apache.org/jira/browse/ACE-53 has already been created for >>>> this. >>>> >>> Looked at ACE-53 and saw your comment on AutoConf. If I use the filebased >>> server and add to my target the >>> org.apache.felix.deployment.rp.autoconf-0.1.0-SNAPSHOT.jar do you think I >>> can drop in an autoconf.xml file in my folder and it will deploy to the >>> target?? >>> >> >> From memory, I think you will need to manually include the resource >> processor for AutoConf too. > Did you mean manually install the autoConf on the target gateway?
No, I meant adding the resource processor bundle to the list of bundles you want installed on the target. > To become more familiar with DeploymentAdmin, configs and the ACE > backend, I decided to experiment with a real deployment package and > install it on the gateway through a felix.webconsole. On the target > gateway I installed the following bundles: > org.apache.felix.dependencymanager.jar > org.apache.felix.deploymentadmin-0.9.0-SNAPSHOT.jar > org.apache.felix.deployment.rp.autoconf-0.1.0-SNAPSHOT.jar > /org.apache.felix.webconsole-2.0.6.jar > > When I try to load a deployment package that contains an resource like: > > Name: autoconf.xml > Resource-Processor: org.osgi.deployment.rp.autoconf > > I get a: > > org.osgi.service.deploymentadmin.DeploymentException: Resource processor for > resource 'autoconf.xml' belongs to foreign deployment package That is correct, according to spec, as the resource processor has to be shipped as part of the deployment package. Of course we could discuss if we should relax that requirement, but that would be going beyond what the spec dictates (and it makes more sense to dynamically install resource processors anyway). > (Seems to me that it should work because it is not associated with a > foriegn deployment package it is just installed normally on the framework. ) As far as I understood it, it has to be in the same DP, but it's been a while since I read the spec. Could you point me to the part of the spec that states that? > If I take the resource processor off my target gateway and include it in > my deployment package I get passed the above error but I keep getting: > > org.osgi.service.deploymentadmin.spi.ResourceProcessorException: Supplied > configuration is not conform the metatype xml specification. > at > org.apache.felix.deployment.rp.autoconf.AutoConfResourceProcessor.process(AutoConfResourceProcessor.java:98) > at > org.apache.felix.deploymentadmin.spi.ProcessResourceCommand.execute(ProcessResourceCommand.java:92) > at > org.apache.felix.deploymentadmin.spi.DeploymentSessionImpl.call(DeploymentSessionImpl.java:71) > at > org.apache.felix.deploymentadmin.DeploymentAdminImpl.installDeploymentPackage(DeploymentAdminImpl.java:215) > > > Tried various simpler autoconf.xml files even some out of the compendium > (just to see if I can get a different error besides > the parsing error) but can't get can't get passed the above parsing error. I > can get cruder parsing errors but the one above > is one that is thrown if no metadata is produced. This should work. Again, from memory, I do remember some examples in the spec being wrong. This should work! To better debug it, I don't have any advice beyond actually running it in a debugger and tracing through the code that way. > Perhaps I am doing something glaringly wrong? No, you're on the right path. Within luminis we use a GUI to edit these configurations, so I quickly used it to generate an example: <?xml version="1.0" encoding="UTF-8"?> <MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> <OCD name="ocd" id="ocd"> <AD id="firstName" type="STRING" cardinality="0" /> <AD id="lastName" type="STRING" cardinality="0" /> </OCD> <Designate pid="myfirstpid" factoryPid="" bundle="mybundle" merge="false" optional="false"> <Object ocdref="ocd"> <Attribute adref="firstName"> <Value><![CDATA[Marcel]]></Value> </Attribute> <Attribute adref="lastName"> <Value><![CDATA[Offermans]]></Value> </Attribute> </Object> </Designate> </MetaData> Let me know if you have more luck with this one (you probably need to edit it a bit so it applies to the right bundle, etc. > Sorry if I am outside the scope of Ace and into a more generic > discussion of Deployment Admin. It's in scope as far as I'm concerned. We initially developed and donated the DA implementation to Apache Felix because at that time, ACE did not exist as an open source project yet (and it makes sense because it's a compendium service, so Felix is a great place to maintain that). However, it's an important part of ACE so I do think it's in scope to discuss it here. Greetings, Marcel
