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 |
Jens Muehlenhoff 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 |
Eclipse User |
|
|
|
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 #523556 is a reply to message #523548] |
Fri, 26 March 2010 15:04 |
Eclipse User |
|
|
|
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
|
|
| |
Goto Forum:
Current Time: Sat Apr 20 03:20:36 GMT 2024
Powered by FUDForum. Page generated in 0.02868 seconds
|