Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » SCR and Config Admin: Warning message if no config is avaliable
SCR and Config Admin: Warning message if no config is avaliable [message #523334] Thu, 25 March 2010 22:57 Go to next message
Jens Muehlenhoff is currently offline Jens MuehlenhoffFriend
Messages: 20
Registered: July 2009
Junior Member
Hello,

I'm fighting with the SCR and the Config Admin. Now everything is working fine,
except the following annoying warning:

!ENTRY de.kue.example.scr 2 0 2010-03-25 23:46:58.516
!MESSAGE The 'ExampleService' component's configuration could not be satisfied because it is
required to be initialized by a ConfigurationAdmin service Configuration object, but one was not found.

I have the following configuration:

<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
configuration-policy="require" enabled="true" immediate="false"
name="ExampleService" modified="modified" >
<implementation class="de.kue.example.scr.ExampleService" />
<service servicefactory="true">
<provide interface="de.kue.example.scr.IExampleService" />
</service>
</scr:component>

Starting the framework the first time, there will be not configuration, because I will create them
by hand. Second, it is a "normal" situation, that there is no configuration at all. After I created
a configurtion like this

config = configurationAdmin.createFactoryConfiguration("ExampleService ");
config.update(props);

Everything is fine. If I delete the configuration, I get the annoying warning.

If I add a

<reference bind="setDependingService" cardinality="1..1"
interface="de.kue.example.scr.IDependingService" name="IDependingService" policy="dynamic"
unbind="unsetDependingService"/>

and the depending service is going down, all ExampleServices will go down, without warning. That's fine.

Is there a chance to get ride of this warning, can I turn it off, because if I install the software
at the customer, they will ask our helpdesk what such warning mean.

Any suggestions? Thanks in advanced.

Jens
Re: SCR and Config Admin: Warning message if no config is avaliable [message #523399 is a reply to message #523334] Fri, 26 March 2010 10:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kai.edinger.drexler-software.de

Hello Jens,

Am 25.03.2010 23:57, schrieb Jens:
> Hello,
>
> I'm fighting with the SCR and the Config Admin. Now everything is working fine,
> except the following annoying warning:
>
> !ENTRY de.kue.example.scr 2 0 2010-03-25 23:46:58.516
> !MESSAGE The 'ExampleService' component's configuration could not be satisfied because it is
> required to be initialized by a ConfigurationAdmin service Configuration object, but one was not found.
>
> I have the following configuration:
>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
> configuration-policy="require" enabled="true" immediate="false"
^^^^^^^ change this to optional.

I think this should be the solution.

> name="ExampleService" modified="modified">
> <implementation class="de.kue.example.scr.ExampleService" />
> <service servicefactory="true">
> <provide interface="de.kue.example.scr.IExampleService" />
> </service>
> </scr:component>
>
> Starting the framework the first time, there will be not configuration, because I will create them
> by hand. Second, it is a "normal" situation, that there is no configuration at all. After I created
> a configurtion like this
>
> config = configurationAdmin.createFactoryConfiguration("ExampleService ");
> config.update(props);
>
> Everything is fine. If I delete the configuration, I get the annoying warning.
>
> If I add a
>
> <reference bind="setDependingService" cardinality="1..1"
> interface="de.kue.example.scr.IDependingService" name="IDependingService" policy="dynamic"
> unbind="unsetDependingService"/>
>
> and the depending service is going down, all ExampleServices will go down, without warning. That's fine.
>
> Is there a chance to get ride of this warning, can I turn it off, because if I install the software
> at the customer, they will ask our helpdesk what such warning mean.
>
> Any suggestions? Thanks in advanced.
>
> Jens
>
>
>

Kai
Re: SCR and Config Admin: Warning message if no config is avaliable [message #523548 is a reply to message #523399] Fri, 26 March 2010 18:32 Go to previous messageGo to next message
Jens Muehlenhoff is currently offline Jens MuehlenhoffFriend
Messages: 20
Registered: July 2009
Junior Member
Kai Edinger wrote:
> Hello Jens,
>
> Am 25.03.2010 23:57, schrieb Jens:
>> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
>> configuration-policy="require" enabled="true" immediate="false"
> ^^^^^^^ change this to optional.
>
> I think this should be the solution.
> Kai

Hello Kai, I had tested this already. The problem with the optional solutions is, equinox then
always creates a component. I do not know if it is a bug, or if it is because there is an other
compontent depending on this one.

A depends on B. B should only by there if it has a configuration. I will check if it works, if there
are no other dependency on B. Will come later back to this.
Re: SCR and Config Admin: Warning message if no config is avaliable [message #523556 is a reply to message #523548] Fri, 26 March 2010 15:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kai.edinger.drexler-software.de

Am 26.03.2010 19:32, schrieb Jens:
> Kai Edinger wrote:
>> Hello Jens,
>>
>> Am 25.03.2010 23:57, schrieb Jens:
>>> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
>>> configuration-policy="require" enabled="true" immediate="false"
>> ^^^^^^^ change this to optional.
>>
>> I think this should be the solution.
>> Kai
>
> Hello Kai, I had tested this already. The problem with the optional solutions is, equinox then
> always creates a component. I do not know if it is a bug, or if it is because there is an other
> compontent depending on this one.
Yes, I thing that is not a bug, it is caused by the dependency.

>
> A depends on B. B should only by there if it has a configuration. I will check if it works, if there
> are no other dependency on B. Will come later back to this.

This may help you. Change the cardinality in the reference definition to
0..1

----8<----
<reference bind="setDependingService" cardinality="0..1"
interface="de.kue.example.scr.IDependingService"
name="IDependingService" policy="dynamic"
unbind="unsetDependingService"/>
----8<----

Kai
Re: SCR and Config Admin: Warning message if no config is avaliable [message #523558 is a reply to message #523399] Fri, 26 March 2010 20:24 Go to previous message
Jens Muehlenhoff is currently offline Jens MuehlenhoffFriend
Messages: 20
Registered: July 2009
Junior Member
Kai Edinger wrote:
>>
>> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0"
>> configuration-policy="require" enabled="true" immediate="false"
> ^^^^^^^ change this to optional.
>
> I think this should be the solution.
>
>
> Kai

Hello Kay, I give it a try. The error message has gone, but after starting equinox creates a
service. Thats not what I expect. I want no service, if there is no configuration and if there is a
configuration there should be one Service/Component for one configuration.

I thinks the message is a bug.
Previous Topic:Error when mirroring GEF 3.5.2 p2 repository
Next Topic:Service does not start
Goto Forum:
  


Current Time: Sat Apr 20 03:20:36 GMT 2024

Powered by FUDForum. Page generated in 0.02868 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top