Closed tory-kk closed 1 year ago
As far as I see right now, there seem to be multiple issues with this setup. I'll investigate that further and report back later...
Alright... after a 2 days of investigation and trail & error I finally got it.
This setup has two major problems, one is a bug in dbus-java, the other is the usage of dbus-send
.
First the bug: When using dbus-java as DBusDaemon, messages which has to be forwarded from one application to another (app1 exports something app2 wants to call) failed due to broken message headers.
This was a really difficult to find and fix bug.
When the DBusDaemon receives the result of the call from app1 it changes the message header and sends the message to the requester (app2). The header is updated when setSource(String)
is called on the message.
This code is pretty difficult to understand and it seems to be broken since the beginning of this project.
In that method, the message is cleared and re-filled after the header has been changed. The changed header was wrong and the resulting message was unreadable by dbus-send
.
The second issue is your usage of dbus-send
.
When using dbus-send
with --address
option, it does not do proper handshaking. It just sends the method call you want to run but omits sending the "Hello" message.
To get this to work, you have to set the DBUS_SESSION_BUS_ADDRESS environment variable.
Example:
DBUS_SESSION_BUS_ADDRESS="tcp:host=localhost,port=43540,guid=c6d8a3d70fdfcc80ce03510ee263acb8" dbus-send --print-reply --reply-timeout=600000 --type=method_call --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager.StartUnit string:'test.service' string:'replace'
Thank you very much! Everything works perfectly. :) Are there any estimates about the release of a new version?
Nope, no ETA for any release. Maybe in a few weeks somewhere in february/march depending on how much issues are arsing until then.
Hello, Currently, we have a setup with Java DBus daemon, Java service that exports object, and Java client that sends messages to the exported object. And it works like a charm.
However, we recently noticed that
dbus-send
tool does not work properly - it doesn't receive a response from Java daemon.An example: We tried to send messages to the daemon via command-line and got the following response:
At the same time if the request is sent without asking for response the command-line succeeds:
If we send command to the system DBus, response from the requested service is received:
Is there some miss-configuration of the daemon on our side? Are we doing something wrong or missing something? Please help us to solve the issue.
Attaching a gist with simple project with the daemon and exporter: link