AnsweredAssumed Answered

Strange (threading?) issue regarding rest services

Question asked by atcevik on Apr 22, 2013
Latest reply on May 8, 2013 by frederikheremans1

I am using angularjs to call activiti-rest interface.

The scenario I am following is,

1. Listing all tasks of a user - OK

Request URL:http://localhost:8088/activiti-rest/service/tasks?assignee=kermit&start=0
Request Method:GET
Status Code:200 OK

2. Completing the task - OK
Request URL:http://localhost:8088/activiti-rest/service/task/578/complete
Request Method:PUT
Status Code:200 OK

3. Refreshing the task list - NOT OK!

Request URL:http://localhost:8088/activiti-rest/service/tasks?assignee=kermit&start=0
Request Method:GET
Status Code:404 Not Found

it is strange, as the call is the same at (1), double checked it. The response is strange,

   <title>Status page</title>
<body style="font-family: sans-serif;">
<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">No task found for taskId &apos;578&apos;</p>
<p>The server has not found anything matching the request URI</p>
<p>You can get technical details <a href="">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.

Huh ? TaskID ? I havent been sending one… The headers :

Accept:application/json, text/plain, */*
Authorization:Basic a2VybWl0Omtlcm1pdA==
User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31

Actually, after the error, I resent the same call, using chromes developer tools, so no modification, and returns http 200 again after the failure.

The only difference, is calling the list method just after the complete method on the failing one. I am calling the list method immediately after calling complete, as the complete call is implemented in a callback, maybe the function has not been finished yet, so that might be the reason, but the failure message is garbage. I am wondering if there are some multithreading problems. Would be really glad if you could help me out. Thanks.