On Jul 17, 2014, at 11:18 AM, Vladimir Bokov <bokov.v...@gmail.com> wrote: > I'm trying to communicate with DBus via https://github.com/cathive/fx-dbus > java lib, but > passing an object which extends java abstract generic inner class complains, > that it cannot be cast > to parent class: > > ClassCastException Cannot cast > org.freedesktop.dbus.Message$StringMethodArgument to > [Lorg.freedesktop.dbus.Message$MethodArgument; java.lang.Class.cast > (Class.java:3258)
This says it is expecting an array (that's what the 'L' signifies). Java variadic functions like this: public void addArguments(final MethodArgument... arguments) { need an array passed in. You'll need something like (into-array org.freedesktop.dbus.Message$MethodArgument [app-name]) instead of just app-name in your .addArgument call. Sean Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ "Perfection is the enemy of the good." -- Gustave Flaubert, French realist novelist (1821-1880)
signature.asc
Description: Message signed with OpenPGP using GPGMail