you should debug it as any other java based application - add debug arguments while executing demo task service, for JBoss follow again, regular way to debug application server. You can use your IDE, for instance Eclipse to start task service and JBoss.
It is difficult to help you without knowing exact environment setup.