JasperServer-for-PHP
JasperServer-for-PHP copied to clipboard
Fatal error: Uncaught exception 'Jasper\RESTRequestException' with message 'Unexpected HTTP code returned: 401 Body of response
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
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.