Your task service should be up and running before you execute this code.
May the problem is with the connection. Try using localhost instead of 127.0.0.1 or may be verify the port with the default port set in the war file.
Reply to this message by going to Community
Start a new discussion in jBPM at Community