Error loading the "myservice" service generated by orocreate-pkg

Hi,

After having created a package with orocreate-pkg and built i, I may deploy
and load the default component, but I can't load the myservice plugin
(whereas it is present in the .sevcie list and I may load the os service)

Deployer [S]> .services
Available Services: marshalling scripting print Lua os myservice

Deployer [S]> loadService ("Component1","myservice")
18.589 [ ERROR ][Logger] You are not allowed to call provides() on a
Service that does not yet belong to a TaskContext or another Service.
18.589 [ ERROR ][Logger] Try to avoid using provides() in this case: omit
it or use the service directly.
18.589 [ ERROR ][Logger] Service or Plugin myservice threw an exception
during loading in Component1
18.589 [ ERROR ][Logger] Exception: Illegal use of provides()
= false

Deployer [S]> loadService ("Component1","os")
= true

Deployer [S]>

Is it a sample code error ? Or do I load the service badly ?

Error loading the "myservice" service generated by orocreate-pkg

On Wed, Feb 23, 2011 at 11:52 PM, Willy Lambert <lambert [dot] willy [..] ...> wrote:
> Hi,
>
> After having created a package with orocreate-pkg and built i, I may deploy
> and load the default component, but I can't load the myservice plugin
> (whereas it is present in the .sevcie list and I may load the os service)
>
> Deployer [S]> .services
> Available Services: marshalling scripting print Lua os myservice
>
> Deployer [S]> loadService ("Component1","myservice")
> 18.589 [ ERROR  ][Logger] You are not allowed to call provides() on a
> Service that does not yet belong to a TaskContext or another Service.
> 18.589 [ ERROR  ][Logger] Try to avoid using provides() in this case: omit
> it or use the service directly.
> 18.589 [ ERROR  ][Logger] Service or Plugin myservice threw an exception
> during loading in Component1
> 18.589 [ ERROR  ][Logger] Exception: Illegal use of provides()
>  = false
>
> Deployer [S]> loadService ("Component1","os")
>  = true
>
> Deployer [S]>
>
>
> Is it a sample code error ? Or do I load the service badly ?

A bug slipped in the template code for the services.

Change the line provides()->addOperation(..) to this->addOperation().

This issue will be fixed in 2.3.0 if you use boost 1.40.0 or higher,
ie, the sample code will be 'correct' by then.

It's a chicken-and-egg problem with shared_ptrs which we couldn't
solve with earlier boost versions, and only understood until recently.

Peter
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

Error loading the "myservice" service generated by orocreate-pkg

2011/2/24 Peter Soetens <peter [..] ...>

> On Wed, Feb 23, 2011 at 11:52 PM, Willy Lambert <lambert [dot] willy [..] ...>
> wrote:
> > Hi,
> >
> > After having created a package with orocreate-pkg and built i, I may
> deploy
> > and load the default component, but I can't load the myservice plugin
> > (whereas it is present in the .sevcie list and I may load the os service)
> >
> > Deployer [S]> .services
> > Available Services: marshalling scripting print Lua os myservice
> >
> > Deployer [S]> loadService ("Component1","myservice")
> > 18.589 [ ERROR ][Logger] You are not allowed to call provides() on a
> > Service that does not yet belong to a TaskContext or another Service.
> > 18.589 [ ERROR ][Logger] Try to avoid using provides() in this case:
> omit
> > it or use the service directly.
> > 18.589 [ ERROR ][Logger] Service or Plugin myservice threw an exception
> > during loading in Component1
> > 18.589 [ ERROR ][Logger] Exception: Illegal use of provides()
> > = false
> >
> > Deployer [S]> loadService ("Component1","os")
> > = true
> >
> > Deployer [S]>
> >
> >
> > Is it a sample code error ? Or do I load the service badly ?
>
> A bug slipped in the template code for the services.
>
> Change the line provides()->addOperation(..) to this->addOperation().
>
> This issue will be fixed in 2.3.0 if you use boost 1.40.0 or higher,
> ie, the sample code will be 'correct' by then.
>
> It's a chicken-and-egg problem with shared_ptrs which we couldn't
> solve with earlier boost versions, and only understood until recently.

> Peter
>

Thanks for this, it solved my problem

Error loading the "myservice" service generated by orocreate-pkg

On Thu, Feb 24, 2011 at 12:44 AM, Peter Soetens <peter [..] ...>wrote:

> On Wed, Feb 23, 2011 at 11:52 PM, Willy Lambert <lambert [dot] willy [..] ...>
> wrote:
> > Hi,
> >
> > After having created a package with orocreate-pkg and built i, I may
> deploy
> > and load the default component, but I can't load the myservice plugin
> > (whereas it is present in the .sevcie list and I may load the os service)
> >
> > Deployer [S]> .services
> > Available Services: marshalling scripting print Lua os myservice
> >
> > Deployer [S]> loadService ("Component1","myservice")
> > 18.589 [ ERROR ][Logger] You are not allowed to call provides() on a
> > Service that does not yet belong to a TaskContext or another Service.
> > 18.589 [ ERROR ][Logger] Try to avoid using provides() in this case:
> omit
> > it or use the service directly.
> > 18.589 [ ERROR ][Logger] Service or Plugin myservice threw an exception
> > during loading in Component1
> > 18.589 [ ERROR ][Logger] Exception: Illegal use of provides()
> > = false
> >
> > Deployer [S]> loadService ("Component1","os")
> > = true
> >
> > Deployer [S]>
> >
> >
> > Is it a sample code error ? Or do I load the service badly ?
>
> A bug slipped in the template code for the services.
>
> Change the line provides()->addOperation(..) to this->addOperation().
>
> This issue will be fixed in 2.3.0 if you use boost 1.40.0 or higher,
> ie, the sample code will be 'correct' by then.
>
> It's a chicken-and-egg problem with shared_ptrs which we couldn't
> solve with earlier boost versions, and only understood until recently.
>

Is there any doc (maybe from boost) that explains the problem and the
solution?. I got curious, but don't really know what the problem is, so I
can't search for it :)

Adolfo.

> Peter
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>

Error loading the "myservice" service generated by orocreate-pkg

2011/2/24 Adolfo Rodríguez Tsouroukdissian <adolfo [dot] rodriguez [..] ...>:
>
>
> On Thu, Feb 24, 2011 at 12:44 AM, Peter Soetens <peter [..] ...>
> wrote:
>>
>> On Wed, Feb 23, 2011 at 11:52 PM, Willy Lambert <lambert [dot] willy [..] ...>
>> wrote:
>> > Hi,
>> >
>> > After having created a package with orocreate-pkg and built i, I may
>> > deploy
>> > and load the default component, but I can't load the myservice plugin
>> > (whereas it is present in the .sevcie list and I may load the os
>> > service)
>> >
>> > Deployer [S]> .services
>> > Available Services:  marshalling scripting print Lua os myservice
>> >
>> > Deployer [S]> loadService ("Component1","myservice")
>> > 18.589 [ ERROR  ][Logger] You are not allowed to call provides() on a
>> > Service that does not yet belong to a TaskContext or another Service.
>> > 18.589 [ ERROR  ][Logger] Try to avoid using provides() in this case:
>> > omit
>> > it or use the service directly.
>> > 18.589 [ ERROR  ][Logger] Service or Plugin myservice threw an exception
>> > during loading in Component1
>> > 18.589 [ ERROR  ][Logger] Exception: Illegal use of provides()
>> >  = false
>> >
>> > Deployer [S]> loadService ("Component1","os")
>> >  = true
>> >
>> > Deployer [S]>
>> >
>> >
>> > Is it a sample code error ? Or do I load the service badly ?
>>
>> A bug slipped in the template code for the services.
>>
>> Change the line provides()->addOperation(..) to this->addOperation().
>>
>> This issue will be fixed in 2.3.0 if you use boost 1.40.0 or higher,
>> ie, the sample code will be 'correct' by then.
>>
>> It's a chicken-and-egg problem with shared_ptrs which we couldn't
>> solve with earlier boost versions, and only understood until recently.
>
> Is there any doc (maybe from boost) that explains the problem and the
> solution?. I got curious, but don't really know what the problem is, so I
> can't search for it :)

We use enable_shared_from_this, which doesn't support
shared_from_this() in the constructor. I had to use
enable_shared_from_this2 which is only available in boost 1.40 and
newer. The latter is undocumented in boost though.

Peter

>
> Adolfo.
>
>>
>> Peter
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>
>
> --
> Adolfo Rodríguez Tsouroukdissian
>
> Robotics engineer
> PAL ROBOTICS S.L
> http://www.pal-robotics.com
> Tel. +34.93.414.53.47
> Fax.+34.93.209.11.09
>
> CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may
> contain confidential information which is privileged and intended only for
> the individual or entity to whom they are addressed.  If you are not the
> intended recipient, you are hereby notified that any disclosure, copying,
> distribution or use of this e-mail and/or accompanying document(s) is
> strictly prohibited.  If you have received this e-mail in error, please
> immediately notify the sender at the above e-mail address.
>
--
Orocos-Users mailing list
Orocos-Users [..] ...
http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users