service activation by getRemoteObject not working
Olaf Brandt
obcsystems at t-online.de
Thu Apr 17 11:25:25 PDT 2008
Hi John,
yes you are right, I'm first getting the connection and then I create
the object that is beeing exported.
So I will try to connect to the bus, then setup the object and
afterwards get the busname.
Thanks
Olaf
John (J5) Palmieri schrieb:
> On Thu, 2008-04-17 at 18:39 +0200, Olaf Brandt wrote:
>
>> Hi,
>>
>> the service is implemented in Java as well.
>> I'm at home now and can not state the exact Exception, but
>> the text is like "/MyObject is not an Object provided by this service"
>>
>> I made the connection to the bus in the static block of the class.
>> Then there are done some other things before aquiring the wellknown
>> busname and exporting the object.
>> Maybe it is better to connect to the bus right before going to export
>> the object ?
>>
>> I will try tomorrow and let you hear about the results.
>>
>> Olaf
>>
>
> Sounds like you are grabbing a bus name before you have set up your
> objects. We do this in Python too but being single threaded means the
> object is registered before any processing of messages are done. If I
> have to guess, since D-Bus Java is heavily mutli-threaded, there is a
> race between when the name is added to the bus, the message is processed
> and objects are registered. Matthew will know best though.
>
>
>> Matthew Johnson schrieb:
>>
>>> On Thu Apr 17 17:56, Olaf Brandt wrote:
>>>
>>>
>>>> I'm trying to use DBus-Java on SuSE Linux Enterprise Server 10.
>>>> I'm gone use DBus to start other services.
>>>>
>>>> As mentioned in the Java-Doc of getRemoteObject the service should start,
>>>> if the busname requested can not be found on the bus.
>>>> This doesn't work. It starts not until I call a method on the
>>>> Proxyobject I got.
>>>>
>>>>
>>> It is correct that it should not start until you call a method. Possibly
>>> the docs are badly worded, it's meant to read as "the resulting proxy
>>> will auto start the service...".
>>>
>>>
>>>
>>>> But then this method call throws an Exception, because the Object is not
>>>> (in this moment) exported.
>>>> If I call a second time, everything is fine, the object can be found and
>>>> the methodcall returns normally.
>>>>
>>>>
>>> This is strange. Which exception do you get and what is the service
>>> implemented in. The method call won't be delivered until that process
>>> connects to the bus and hence shouldn't return an exception until then.
>>> It's possible there's a race condition where the message is delivered to
>>> the service between connection and exporting the object. I'm not sure
>>> how people normally cope with that?
>>>
>>>
>>>
>>>> The dbus-daemon -version shows 0.6. Maybe the service activation is not
>>>> working well in this relaese ?
>>>>
>>>>
>>> It _should_ be fine, but that is quite an old version. If you could try
>>> it with version 1.something that would be better, although I'd be
>>> surprised if it made a difference.
>>>
>>> Matt
>>>
>>>
>>>
--
Olaf Brandt
Computer + Systeme
Alte Dorfstrasse 9
32699 Extertal-Almena
Steuernummer: 329/5009/1085
Umsatzsteuer-ID: DE184118443
http://www.obcsystems.de
More information about the dbus
mailing list