I think line 81 should be also modified to:
order.waitForUpdate(900000, CLOSED); // As we want to wait till the order is CLOSED, not FILLED.
But this is just a sidenote. It won't 'solve' the error you got.
Alternatively you could consider to move the order closing part to the onMessage() function. Whenever the order gets filled, there will be an onMessage() call, so you could implement the close part there.
I know that this is just an example, and it is not a real strategy, but why not consider other (more sophisticated) approaches right away?

This is the onMessage() code:
public void onMessage(IMessage message) throws JFException {
IOrder anOrder;
switch (message.getType()) {
case ORDER_FILL_OK:
anOrder = message.getOrder();
try {
console.getOut().println("closing order: " + anOrder);
anOrder.close();
//order.waitForUpdate(900000, CLOSED); // no need for this here
} catch (JFException e) {
e.printStackTrace();
}
}
}
Hope this helps.