Java simulator: set error code to StatusCode.INVALID_REQUEST if
Domain/Permission validation failed.  

Test cases are updated also to reflect the above changes.