dbus java DirectConnection FatalDBusException

Matthew Johnson dbus at matthew.ath.cx
Wed Jan 11 16:34:10 PST 2012


On Wed Jan 11 19:24, Edgar Domingues wrote:
> Hi,
> 
> I'm trying to run dbus in java using DirectConnection.
> The client connects to the server and calls remote methods with no problems.
> But when I call the disconnect method in the client both Server and
> Client crashes.
> I tested my code both in linux and windows and the problem is the same.
> Code and exception description follows.

Interesting. The exceptions seem like they should be expected - you are,
indeed, closing the socket and returning EOF. Direct connections aren't the
primary use case, so are likely to be tested less well. I have a test
client/server in dbus-java (tests/test-p2p-client and server) which seem to run
without incident, including calling disconnect in the client.

Can you tell me whether in the top of the source tree you get any errors with:

	make peer-server &

	(wait until it's running)

	make peer-client

I can run this without error, even on TCP, there's no _obvious_ reason yours
should be different.

> The server exception is:
> org.freedesktop.dbus.exceptions.FatalDBusException: Underlying
> transport returned EOF
> 	at org.freedesktop.dbus.AbstractConnection.readIncoming(Unknown Source)
> 	at org.freedesktop.dbus.AbstractConnection.access$000(Unknown Source)
> 	at org.freedesktop.dbus.AbstractConnection$_thread.run(Unknown Source)
> The client exception is:
> org.freedesktop.dbus.exceptions.FatalDBusException: Socket closed
> 	at org.freedesktop.dbus.AbstractConnection.readIncoming(Unknown Source)
> 	at org.freedesktop.dbus.AbstractConnection.access$000(Unknown Source)
> 	at org.freedesktop.dbus.AbstractConnection$_thread.run(Unknown Source)

In fact, looking at teh code in AbstractConnection._thread.run, it's all
wrapped in a try/catch block which will squash the message unless you have
logging enabled in the library and have DBUS_JAVA_EXCEPTION_DEBUG set in your
environment, so I'm slightly confused as to why you're getting the exceptions.
If you have debugging on, then yes, it'll print the exception, but that's
harmless. If not - I don't see why you should see it.

Matt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20120112/d60be7d4/attachment.pgp>


More information about the dbus mailing list