AnsweredAssumed Answered

Exception Access to restricted URI denied

Question asked by kavi on Jul 14, 2011
Hi ,

I am using javascript to start a process instance using rest API
  But i am getting "Exception Access to restricted URI denied".

Here is my code
<script type="text/javascript">
   function sendPost()
    {
         try {

             var xhr = new XMLHttpRequest();
             var url = "http://localhost:8080/activiti-rest/service/process-instance";
            xhr.open("POST", url, true,"kermit","kermit");
            xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            xhr.onreadystatechange = function() {
                alert(xhr.status);
                if (xhr.readyState == 4 && xhr.status == 200) {
                    //check for an error message contained in the REST response.
                    //If xhr.responseText is blank, update was successful.
                    alert("SUCCESS");
                }
                else {
                    alert("ERROR in RESPONSE: " + xhr.status + " , " + xhr.responseText);
                }
            }
    xhr.send("processDefinitionKey=bookorder"); //working[/color]  // REST CALL
      
     }
        catch(ex)
        {
            alert("Exception"+ex.message);
        }
       
    }
</script>

What am i missing?

Thanks,
kavi

Outcomes