Command Arduino Uno using Ardulink in a JAVA application


I am trying to command my Arduino Uno using Ardulink library in my JAVA application but without success I don't know what have I missed, here is my code:

Link link = Link.getDefaultInstance();
boolean connected = link.connect("COM6", 57600);
MessageInfo msg=link.sendPowerPinSwitch(17, IProtocol.POWER_HIGH);

In arduino example, it uses this functions of the Servo class to command:

attach(port);pinMode(A3,OUTPUT); digitalWrite(A3, HIGH);
write (135)

Here is the exception that I got:

Exception in thread "Thread-2" java.lang.ArrayIndexOutOfBoundsException: 1024
    at org.zu.ardulink.connection.serial.AbstractSerialConnection$
    at Source)

It looks like your Java app is trying to access an array incorrectly. Perhaps the fine folks at could help you.

Post the complete code.

However if you are getting a Java error you should be asking on a Java forum.