Monday, April 25, 2022

Http failure response for http://localhost:8080/alluser: 0 Unknown Error","error":{"isTrusted":true}

For a mini project I used spring boot as API and angular as UI.  In Spring boot I have added spring-boot-starter-security for secured my application. And I added my implementation for add/update/view data. After that I started working with Angular front end with mock data. 

Then I started integration part of UI with API. The first call I made from UI to API to fetch the uses available in DB and display them in list. While calling from UI, backend did not allow the UI request, because we have security check in API. In API I added security username and password. 

spring.security.user.name=user
spring.security.user.password=user

So we need to added security config to resolve this issue. I will post the solution
in next post.


Here is full error stack trace:
 main.js:1 ERROR Error: Uncaught (in promise): s1: {"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown Error","url":"http://localhost:8080/alluser","ok":false,"name":"HttpErrorResponse","message":"Http failure response for http://localhost:8080/alluser: 0 Unknown Error","error":{"isTrusted":true}}
    at _e (polyfills.js:1:160289)
    at _e (polyfills.js:1:159769)
    at polyfills.js:1:161152
    at X.invokeTask (polyfills.js:1:154522)
    at Object.onInvokeTask (main.js:1:255253)
    at X.invokeTask (polyfills.js:1:154442)
    at X.runTask (polyfills.js:1:149526)
    at te (polyfills.js:1:156890)
    at X.invokeTask [as invoke] (polyfills.js:1:155703)
    at ee (polyfills.js:1:169257)

Thank you.

No comments:

Post a Comment