Revision history [back]

click to hide/show revision 1
initial version

Returning an Integer (Type-wrapper) Array in Java

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?