Re: Configuring a service using sling:OsgiConfig

2015-02-04 Thread connuser1 connuser1
Ok. Thanks for clarifying. I could setup OsgiConfig nodes manually as well
but in any case, the setting done via console would override.

On Mon, Feb 2, 2015 at 7:16 PM, Bertrand Delacretaz bdelacre...@apache.org
wrote:

 On Mon, Feb 2, 2015 at 2:39 PM, connuser1 connuser1 connus...@gmail.com
 wrote:

  On Mon, Feb 2, 2015 at 7:03 PM, Bertrand Delacretaz 
 bdelacre...@apache.org
  wrote:
 Why do you have both the .config file and the sling:OsgiConfig nodes
  for the same service pid?
 
  I edited the config once using felix console. I think it created the
  .config file while the sling:OsgiConfig node was already created by me
  earlier

 Ok, I don't have time to look up the details right now but I suppose
 that's by design, as the installer aims to give priority to stuff that
 you setup manually.

 -Bertrand



Re: Configuring a service using sling:OsgiConfig

2015-02-02 Thread connuser1 connuser1
Why do you have both the .config file and the sling:OsgiConfig nodes
for the same service pid?

I edited the config once using felix console. I think it created the
.config file while the sling:OsgiConfig node was already created by me
earlier.

On Mon, Feb 2, 2015 at 7:03 PM, Bertrand Delacretaz bdelacre...@apache.org
wrote:

 Hi,

 On Mon, Feb 2, 2015 at 2:25 PM, connuser1 connuser1 connus...@gmail.com
 wrote:
  ...I think whenever a  install/service-pid.config node gets
  created in the repo, the changes done to the sling:OsgiConfig node stop
  taking effect

 Yes, if you have two ways of specifying the config of a given
 service-pid, one will be ignored, based on the priorities that the
 installer sets on them (by default, /apps overrides /libs for
 example).

 Why do you have both the .config file and the sling:OsgiConfig nodes
 for the same service pid?

 -Bertrand



Re: Configuring a service using sling:OsgiConfig

2015-02-02 Thread Julian Sedding
The class org.apache.sling.installer.provider.jcr.impl.JcrInstaller is
by default configured to only take folders into account that are
called install. In CQ/AEM folders may be called install or
config.

Regards
Julian

On Mon, Feb 2, 2015 at 1:54 PM, Bertrand Delacretaz
bdelacre...@apache.org wrote:
 Hi,

 On Mon, Feb 2, 2015 at 1:48 PM, connuser1 connuser1 connus...@gmail.com 
 wrote:
 ...Editing the
 config once using felix console does some (binding...?) magic which I am
 not sure of

 If you are able to edit your config from the Felix console it means
 that it was indeed created...

 If you create sling:OsgiConfig nodes and the corresponding config
 appears at /system/console/status-Configurations, all is good as far
 as the installer is concerned. If your OSGi component doesn't get the
 config that's a different story, probably a problem in your component.

 -Bertrand


Re: Configuring a service using sling:OsgiConfig

2015-02-02 Thread connuser1 connuser1
Hi Bertrand

My config appears in status-configurations and is also available in the
component's 'activate' method whenever they change. So this part is working
fine. I observed that within my sling instance, there is a config folder
which had the 'service-pid.config' file created for this service. I
deleted that file and restarted sling and now the service is getting
configured correctly as per the config node in the repository. Also I see
that this config file is now updated correctly whenever I edit the service
configuration . I think whenever a  install/service-pid.config node gets
created in the repo, the changes done to the sling:OsgiConfig node stop
taking effect.

Thanks

On Mon, Feb 2, 2015 at 6:24 PM, Bertrand Delacretaz bdelacre...@apache.org
wrote:

 Hi,

 On Mon, Feb 2, 2015 at 1:48 PM, connuser1 connuser1 connus...@gmail.com
 wrote:
  ...Editing the
  config once using felix console does some (binding...?) magic which I am
  not sure of

 If you are able to edit your config from the Felix console it means
 that it was indeed created...

 If you create sling:OsgiConfig nodes and the corresponding config
 appears at /system/console/status-Configurations, all is good as far
 as the installer is concerned. If your OSGi component doesn't get the
 config that's a different story, probably a problem in your component.

 -Bertrand



Re: Configuring a service using sling:OsgiConfig

2015-02-02 Thread Bertrand Delacretaz
Hi,

On Mon, Feb 2, 2015 at 2:25 PM, connuser1 connuser1 connus...@gmail.com wrote:
 ...I think whenever a  install/service-pid.config node gets
 created in the repo, the changes done to the sling:OsgiConfig node stop
 taking effect

Yes, if you have two ways of specifying the config of a given
service-pid, one will be ignored, based on the priorities that the
installer sets on them (by default, /apps overrides /libs for
example).

Why do you have both the .config file and the sling:OsgiConfig nodes
for the same service pid?

-Bertrand


Re: Configuring a service using sling:OsgiConfig

2015-02-02 Thread connuser1 connuser1
Another observation. After editing my service's config atleast once using
the felix console, things start working perfectly, That is, now all changes
that I make in the config node, get applied on the service. Editing the
config once using felix console does some (binding...?) magic which I am
not sure of.

On Mon, Feb 2, 2015 at 6:02 PM, connuser1 connuser1 connus...@gmail.com
wrote:

 While I am still trying to figure out other differences, here are a few
 observations:

 One difference that I found was that the config file was placed in
 'install' folder for sling-test while I was keeping it in 'config' folder
 as per the docs. So I changed it to 'install' folder.  Otherwise the config
 nodes look the same.

 After this change, I see the JCRInstaller kicking in whenever I update the
 config node's property. Here's what I see in the logs:

 JcrInstaller Registering resource with OSGi installer


  But still its not working. For the sling-test config, I see the
 OSGiInstallerImpl being called and then several config events get fired
 while in my case, the OSGiInstallerImpl never gets called.  For e.g.

 02.02.2015 17:45:23.082 *INFO* [OsgiInstallerImpl]
 org.apache.sling.audit.osgi.installer Installed configuration
 org.apache.sling.scripting.jsp.JspScriptEngineFactory from resource
 TaskResource(url=jcrinstall:/apps/sling-test/install/org.apache.sling.scrip
 ting.jsp.JspScriptEngineFactory,
 entity=config:org.apache.sling.scripting.jsp.JspScriptEngineFactory,
 state=INSTALL,
 attributes=[org.apache.sling.installer.api.tasks.ResourceTransformer=:155:,
 service.pid=org.apache.sling.scripting.jsp.JspScriptEngineFactory],
 digest=354ad20d28352775381b06f675117d8a)

 Does this ring a bell...?

 On Mon, Feb 2, 2015 at 5:19 PM, connuser1 connuser1 connus...@gmail.com
 wrote:

 Thanks Bertrand. I'll compare with it.

 On Mon, Feb 2, 2015 at 4:57 PM, Bertrand Delacretaz 
 bdelacre...@apache.org wrote:

 Hi,

 On Mon, Feb 2, 2015 at 11:40 AM, connuser1 connuser1
 connus...@gmail.com wrote:
  ...I am trying to configure a service by creating a node with
 jcr:primaryType
  as sling:OsgiConfig in the /app/my-project/config directory. I am
  following the steps as detailed in [1]. But I am unable to see the
  configuration getting applied...

 The launchpad/test-services bundle includes a sling:OsgiConfig node as
 initial content, that goes under /apps/sling-test/install - you might
 want to install that bundle to compare with what you're doing.

 -Bertrand






Re: Configuring a service using sling:OsgiConfig

2015-02-02 Thread Bertrand Delacretaz
Hi,

On Mon, Feb 2, 2015 at 1:48 PM, connuser1 connuser1 connus...@gmail.com wrote:
 ...Editing the
 config once using felix console does some (binding...?) magic which I am
 not sure of

If you are able to edit your config from the Felix console it means
that it was indeed created...

If you create sling:OsgiConfig nodes and the corresponding config
appears at /system/console/status-Configurations, all is good as far
as the installer is concerned. If your OSGi component doesn't get the
config that's a different story, probably a problem in your component.

-Bertrand


Re: Configuring a service using sling:OsgiConfig

2015-02-02 Thread Bertrand Delacretaz
On Mon, Feb 2, 2015 at 2:39 PM, connuser1 connuser1 connus...@gmail.com wrote:

 On Mon, Feb 2, 2015 at 7:03 PM, Bertrand Delacretaz bdelacre...@apache.org
 wrote:
Why do you have both the .config file and the sling:OsgiConfig nodes
 for the same service pid?

 I edited the config once using felix console. I think it created the
 .config file while the sling:OsgiConfig node was already created by me
 earlier

Ok, I don't have time to look up the details right now but I suppose
that's by design, as the installer aims to give priority to stuff that
you setup manually.

-Bertrand


Configuring a service using sling:OsgiConfig

2015-02-02 Thread connuser1 connuser1
Hi

I am trying to configure a service by creating a node with jcr:primaryType
as sling:OsgiConfig in the /app/my-project/config directory. I am
following the steps as detailed in [1]. But I am unable to see the
configuration getting applied. Could someone please guide, what could I be
missing? What should I debug to figure out the problem?

Thanks

[1] -
http://docs.adobe.com/docs/en/cq/current/deploying/configuring_osgi.html


Re: Configuring a service using sling:OsgiConfig

2015-02-02 Thread connuser1 connuser1
While I am still trying to figure out other differences, here are a few
observations:

One difference that I found was that the config file was placed in
'install' folder for sling-test while I was keeping it in 'config' folder
as per the docs. So I changed it to 'install' folder.  Otherwise the config
nodes look the same.

After this change, I see the JCRInstaller kicking in whenever I update the
config node's property. Here's what I see in the logs:

JcrInstaller Registering resource with OSGi installer


 But still its not working. For the sling-test config, I see the
OSGiInstallerImpl being called and then several config events get fired
while in my case, the OSGiInstallerImpl never gets called.  For e.g.

02.02.2015 17:45:23.082 *INFO* [OsgiInstallerImpl]
org.apache.sling.audit.osgi.installer Installed configuration
org.apache.sling.scripting.jsp.JspScriptEngineFactory from resource
TaskResource(url=jcrinstall:/apps/sling-test/install/org.apache.sling.scrip
ting.jsp.JspScriptEngineFactory,
entity=config:org.apache.sling.scripting.jsp.JspScriptEngineFactory,
state=INSTALL,
attributes=[org.apache.sling.installer.api.tasks.ResourceTransformer=:155:,
service.pid=org.apache.sling.scripting.jsp.JspScriptEngineFactory],
digest=354ad20d28352775381b06f675117d8a)

Does this ring a bell...?

On Mon, Feb 2, 2015 at 5:19 PM, connuser1 connuser1 connus...@gmail.com
wrote:

 Thanks Bertrand. I'll compare with it.

 On Mon, Feb 2, 2015 at 4:57 PM, Bertrand Delacretaz 
 bdelacre...@apache.org wrote:

 Hi,

 On Mon, Feb 2, 2015 at 11:40 AM, connuser1 connuser1
 connus...@gmail.com wrote:
  ...I am trying to configure a service by creating a node with
 jcr:primaryType
  as sling:OsgiConfig in the /app/my-project/config directory. I am
  following the steps as detailed in [1]. But I am unable to see the
  configuration getting applied...

 The launchpad/test-services bundle includes a sling:OsgiConfig node as
 initial content, that goes under /apps/sling-test/install - you might
 want to install that bundle to compare with what you're doing.

 -Bertrand





Re: Configuring a service using sling:OsgiConfig

2015-02-02 Thread connuser1 connuser1
Thanks Bertrand. I'll compare with it.

On Mon, Feb 2, 2015 at 4:57 PM, Bertrand Delacretaz bdelacre...@apache.org
wrote:

 Hi,

 On Mon, Feb 2, 2015 at 11:40 AM, connuser1 connuser1
 connus...@gmail.com wrote:
  ...I am trying to configure a service by creating a node with
 jcr:primaryType
  as sling:OsgiConfig in the /app/my-project/config directory. I am
  following the steps as detailed in [1]. But I am unable to see the
  configuration getting applied...

 The launchpad/test-services bundle includes a sling:OsgiConfig node as
 initial content, that goes under /apps/sling-test/install - you might
 want to install that bundle to compare with what you're doing.

 -Bertrand