ace-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert M. Mather" <robert.mather....@gmail.com>
Subject Re: Some clarifications about ACE template config engine
Date Tue, 14 Apr 2015 17:28:53 GMT
On Mon, Apr 13, 2015 at 11:36 AM, Jan Willem Janssen <
janwillem.janssen@luminis.eu> wrote:

> Hi Robert,
>
> > On 13 Apr 2015, at 18:53, Robert M. Mather <robert.mather.rmm@gmail.com>
> wrote:
> >
> >> Almost: the bundle-attribute needs to be prefixed with “osgi-dp:” to
> make
> >> it clear that the configuration PID (org.amdatu.conf) is for a bundle
> >> that is part of a deployment package. The AutoConf resource processor
> used
> >> by ACE does not allow configurations to be provisioned to bundles that
> are
> >> *not* part of a deployment package.
> >> Apart from that the example metatype is correct, including the template
> >> variable.
> >
> >
> > I haven't done anything to explicitly prepare my bundles as part of a
> > deployment package. Does ACE do this automatically somehow, or do I need
> to
> > modify the bundle to indicate that it's associated with the same
> deployment
> > package as the metatype configuration? I've never worked with the
> > deployment package part of the OSGi spec before…
>
> Short answer: ACE uses deployment packages as vehicle for transporting and
> installing software updates. You do not need to do anything special for
> that.
>
> Long answer: each target is associated with a distribution. Based on the
> software that is already installed and the changes you want to deploy, a
> new deployment package is created once the target asks for this (the target
> knows what version is currently installed, and asks whether a newer version
> is available, and if so, downloads it and installs it). The installation of
> deployment packages is transparant to the target, so there is no need to
> get into its nitty gritty details...
>
>  Ok, then I'm not sure how to explain the issue I'm having. The client
side error log is the same for all the bundles I've tried:

> 2015-04-14 10:13:10 | ERROR | ACE Agent Controller | 1 - Installation of
deployment update failed: Error while processing resource
'com.patronpath.ring.channel.pubnub.PubnubChannel.Config_ring-ace-agent-test_30.0.0.xml'
(463)!
org.osgi.service.deploymentadmin.spi.ResourceProcessorException: No Object
Class Definition found with
id=com.patronpath.ring.channel.pubnub.PubnubChannel
at
org.apache.felix.deployment.rp.autoconf.AutoConfResourceProcessor.process(AutoConfResourceProcessor.java:174)
~[na:na]
at
org.apache.felix.deploymentadmin.spi.ProcessResourceCommand.doExecute(ProcessResourceCommand.java:100)
~[na:na]
at org.apache.felix.deploymentadmin.spi.Command.execute(Command.java:55)
~[na:na]
at
org.apache.felix.deploymentadmin.spi.DeploymentSessionImpl.call(DeploymentSessionImpl.java:77)
~[na:na]
at
org.apache.felix.deploymentadmin.DeploymentAdminImpl.installDeploymentPackage(DeploymentAdminImpl.java:214)
~[na:na]
at
org.apache.ace.agent.impl.DeploymentHandlerImpl.install(DeploymentHandlerImpl.java:237)
~[na:na]

The Object Class Definition is in the OSGI-INF/metatype directory and is
being generated by bnd:

<?xml version='1.0'?>
<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.1.0"
localization="com.patronpath.ring.channel.pubnub.PubnubChannel$Config">

  <OCD name="Pubnub channel config"
id="com.patronpath.ring.channel.pubnub.PubnubChannel">
       <AD name="Pos client id" id="posClientId" cardinality="0"
required="true" type="String"/>
       <AD name="Pubnub publish key" id="pubnubPublishKey" cardinality="0"
required="true" type="String"/>
       <AD name="Pubnub subscribe key" id="pubnubSubscribeKey"
cardinality="0" required="true" type="String"/>
       <AD name="Heartbeat interval seconds" id="heartbeatIntervalSeconds"
cardinality="0" required="true" default="3" type="Integer" description="How
often the Pubnub presence info should be updated."/>
       <AD name="Reconnect interval seconds" id="reconnectIntervalSeconds"
cardinality="0" required="true" default="3" type="Integer"/>
       <AD name="Retreive missed messages" id="retreiveMissedMessages"
cardinality="0" required="true" default="false" type="Boolean"/>
  </OCD>

  <Designate pid="com.patronpath.ring.channel.pubnub.PubnubChannel">
       <Object ocdref="com.patronpath.ring.channel.pubnub.PubnubChannel"/>
  </Designate>
</metatype:MetaData>

The OCD id is correct and I know it's getting picked up by the metatype
service because I can see the correct entry in the configuration tab of the
webconsole, and I'm able to load configuration to it via fileinstall. This
makes it seem as though there is something wrong with the autoconf resource
processor preventing it from finding the OCD. Finally, here is the
<Designate> definition I'm giving to ACE for interpolation:

<?xml version='1.0'?>
<metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.1.0
"
localization="com.patronpath.ring.channel.pubnub.PubnubChannel$Config">
<Designate pid="com.patronpath.ring.channel.pubnub.PubnubChannel"
bundle="osgi-dp:com.patronpath.ring.channel.pubnub">
<Object ocdref="com.patronpath.ring.channel.pubnub.PubnubChannel">
<Attribute adref="posClientId" content="${context.posClientId}" />
<Attribute adref="pubnubPublishKey" content="${context.pubnubPublishKey}" />
<Attribute adref="pubnubSubscribeKey"
content="${context.pubnubSubscribeKey}" />
<Attribute adref="heartbeatIntervalSeconds"
content="${context.heartbeatIntervalSeconds}" />
<Attribute adref="reconnectIntervalSeconds"
content="${context.reconnectIntervalSeconds}" />
<Attribute adref="retreiveMissedMessages"
content="${context.retreiveMissedMessages}" />
</Object>
</Designate>
</metatype:MetaData>

Is there some sort of security or permissions context I'm unaware of that
would prevent the resource processor from seeing the OCD from the bundle?
I'm using the latest binary distribution of ACE and
the org.apache.felix.deployment.rp.autoconf-0.1.5.jar that comes with it. A
possibility I've been asking about on the bndtools group is whether the
empty <Designate> generated by bnd next to the <OCD> might interfere with
the <Designate> I'm supplying via ACE, but I'd expect a different sort of
error if that were the case. Also, it's not straightforward to prevent bnd
from generating the empty <Designate>, so I'm hoping to explore other
possibilities first.

Thanks,

Robert

>
> --
> Met vriendelijke groeten | Kind regards
>
> Jan Willem Janssen | Software Architect
> +31 631 765 814
>
> My world is revolving around INAETICS and Amdatu
>
> Luminis Technologies B.V.
> Churchillplein 1
> 7314 BZ   Apeldoorn
> +31 88 586 46 00
>
> http://www.luminis-technologies.com
> http://www.luminis.eu
>
> KvK (CoC) 09 16 28 93
> BTW (VAT) NL8169.78.566.B.01
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message