BusMethod works, but BusSignal returns org.freedesktop.DBus.Error.ServiceUnknown

asked 2015-07-04 21:17:54 -0700

Baokeyai gravatar image

I have a AllJoyn JS script and I have an interface definition that looks like the following

AJ.interfaceDefinition['org.alljoyn.testface'] = {
  ledToggle: { type:AJ.METHOD },
  ledBoggle: { type:AJ.SIGNAL },

I also have a client side Java interface that looks like the following

@BusInterface (name="org.alljoyn.testface")
public interface SampleInterface {
    void ledToggle() throws BusException;

    void ledBoggle() throws BusException;

When I invoke ledToggle everything works as expected. However, when I run ledBoggle it throws the following stack dump

org.alljoyn.bus.ErrorReplyBusException: org.freedesktop.DBus.Error.ServiceUnknown
  at org.alljoyn.bus.ProxyBusObject.methodCall(Native Method)
  at org.alljoyn.bus.ProxyBusObject.access$300(ProxyBusObject.java:35)
  at org.alljoyn.bus.ProxyBusObject$Handler.invoke(ProxyBusObject.java:264)
  at com.sun.proxy.$Proxy5.ledBoggle(Unknown Source)
  at org.alljoyn.bus.samples.Client.main(Client.java:171)

Additionally when I use wireshark I see a packet for sending and response when invoking ledToggle

236 5.145154000  ALLJOYN 230 Message 0000000009: 'Method call' ledToggle
239 5.169263000  ALLJOYN 142 Message 0000000010: 'Method reply with returned data' Replies to: 000000009 ()

When invoking Boggle I see the following

205 7.360436000  ALLJOYN 230 Message 0000000010: 'Method call' ledBoggle
206 7.365387000  ALLJOYN 190 Message 0000000033: 'Error reply' Replies to: 000000010

In the payload of the response, it provides the "org.freedesktop.DBus.Error.ServiceUnknown". So another weird thing, I've noticed in a few other packets, that it sends a "Signal Emission" for what seems to be a signal

142 5.293599000  ALLJOYN 440 Message 0000000038: 'Signal emission' ExchangeNames (a(sas))

ledBoggle seems to send a "Method call" instead of a "Signal Emission". Anyways, I hope this is enough information for someone to assist.

Much appreciations in advance!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-07-06 05:30:10 -0700

julianbros gravatar image

updated 2015-07-06 05:31:43 -0700

Try to extract the signal out of the BusInterface, I used a seperate interface for emitting signals. Then you have to use an SignalEmitter. Best practice is to take a look at the sample projects AllJoyn provides. JavaSDKDocSignalClient and JavaSDKDocSignalServer is a very good point to start from, when implementing signals for the first time. I tried it myself and everything works fine.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-07-04 21:17:54 -0700

Seen: 98 times

Last updated: Jul 06 '15