0

Returning an Integer (Type-wrapper) Array in Java

asked 2014-09-10 11:23:05 -0700

cs_chance gravatar image

I'm trying to return an Integer[] (the type-wrapper class via java.lang.Integer) via AllJoyn. I am receiving the following error:

  47.018 ****** ERROR ALLJOYN_JAVA lepDisp      ...a/jni/alljoyn_java.cc:9946 | org.alljoyn.bus.MarshalBusException: cannot marshal class [Ljava.lang.Integer; into 'ai'
  47.020 ****** ERROR ALLJOYN_JAVA lepDisp      ...a/jni/alljoyn_java.cc:9946 |     at org.alljoyn.bus.MsgArg.marshal(MsgArg.java:515)
  47.020 ****** ERROR ALLJOYN_JAVA lepDisp      ...a/jni/alljoyn_java.cc:9946 |     at org.alljoyn.bus.MsgArg.marshal(MsgArg.java:537)
  47.020 ****** ERROR ALLJOYN_JAVA lepDisp      ...a/jni/alljoyn_java.cc:9946 | Caused by: java.lang.ClassCastException: [Ljava.lang.Integer; cannot be cast to [I
  47.020 ****** ERROR ALLJOYN_JAVA lepDisp      ...a/jni/alljoyn_java.cc:9946 |     at org.alljoyn.bus.MsgArg.marshal(MsgArg.java:460)
  47.020 ****** ERROR ALLJOYN_JAVA lepDisp      ...a/jni/alljoyn_java.cc:9946 |     at org.alljoyn.bus.MsgArg.marshal(MsgArg.java:537)

I know you need to use @position when transferring complex data types so AllJoyn can marshal them correctly. How would I do this for an Integer array?

edit retag flag offensive close merge delete

Comments

Hi cs_chance, Can you share your bus method signature which would be something like For e.g. @BusMethod(signature = "ai", replySignature = "something")

Nikhil Dabhade ( 2014-09-10 15:20:16 -0700 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-09-10 16:37:54 -0700

Marshalling arrays of java.lang.Integer is not implemented. See https://jira.allseenalliance.org/browse/ASACORE-284 for a similar issue (resolved) about arrays of java.lang.Boolean.

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

Question Tools

Follow
1 follower

Stats

Asked: 2014-09-10 11:23:05 -0700

Seen: 153 times

Last updated: Sep 10 '14