JasperServer-for-PHP icon indicating copy to clipboard operation
JasperServer-for-PHP copied to clipboard

Fatal error: Uncaught exception 'Jasper\RESTRequestException' with message 'Unexpected HTTP code returned: 401 Body of response

Open kaushalkishorejaiswal opened this issue 10 years ago • 1 comments

Hello Marianol, Thanks for sharing this great application. I am using it but got the following error when I clicks on the Web Services Integration link. Can you please help me to solve this issue ?

Fatal error: Uncaught exception 'Jasper\RESTRequestException' with message 'Unexpected HTTP code returned: 401 Body of response: Apache Tomcat/7.0.42 - Error report HTTP Status 401 - Bad credentialstype Status reportmessage Bad credentialsdescription This request requires HTTP authentication.Apache Tomcat/7.0.42' in /var/www/php-sample-app/resources/jasper-rest/client/JasperClient.php:133 Stack trace: #0 /var/www/php-sample-app/resources/jasper-rest/client/JasperClient.php(587): Jasper\JasperClient->prepAndSend('http://localhos...', Array, 'PUT', NULL, true) #1 /var/www/php-sample-app/web_root/repository.php(56): Jasper\JasperClient->getRepository('/') #2 {main} thrown in /var/www/php-sample-app/resources/jasper-rest/client/JasperClient.php on line 133

kaushalkishorejaiswal avatar Jul 03 '14 07:07 kaushalkishorejaiswal

From the look of it here is the issue; "Error report HTTP Status 401 - Bad credentials" A 401 code is an unauthorized code, so for some reason the credentials are not passed properly or the cookie set in login.php was no set properly.

If you look at line 133 of JasperClient.php the code actually sends the Exception of the Status code does not mach the expected ones.

marianol avatar Jul 17 '14 21:07 marianol