"This was working and then I added authentication and it stopped working"

Did you add something on the server that is looking for some sort of 
authentication token or key in the http headers when you added 
authentication that you maybe didn't remove?

"24 Mar 2017;09:50:42.381 DEBUG org.apache.coyote.http11.Http11Processor - 
Error parsing HTTP request header: java.io.EOFException: null"

That's the relevant line you care about in the server debug log I think, 
it's looking for a particular header in the http request and it's null. 
There's often some sort of header required to manage authentication state.



On Thursday, March 23, 2017 at 6:43:26 AM UTC-7, norricorp wrote:
>
> Hi,
> I have a grails rest api server. This returns data when I use curl.
> I have used the angular 2 heroes application to display this data. This 
> was working and then I added authentication and it stopped working. I have 
> returned to the pre authentication set up and I still get the same errors.
> I have logging on grails and I can see that it returns the data. But the 
> data is not displayed within the browser.
>
> I have switched on the browser debugging console. Network does not show 
> any errors but the console shows quite a few. I must admit I do not really 
> understand what is going wrong from this so hopefully someone can point me 
> in the right direction.
>
>
> "url is http://centos64:8080/heroes?max=15";
>
> An error occurred Object { _body: error, status: 0, ok: false, statusText: 
> "", headers: Object, type: 3, url: null }  
>
> EXCEPTION: Uncaught (in promise): Response with status: 0  for URL: null  
>
> ORIGINAL STACKTRACE:  vendor.bundle.js:59773:13
>
> resolvePromise@http://localhost:4200/vendor.bundle.js:98058:31
> resolvePromise@http://localhost:4200/vendor.bundle.js:98043:17
> scheduleResolveOrReject/<@http://localhost:4200/vendor.bundle.js:98092:17
> ZoneDelegate.prototype.invokeTask@
> http://localhost:4200/vendor.bundle.js:97855:21
> NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvokeTask@
> http://localhost:4200/vendor.bundle.js:31513:28
> ZoneDelegate.prototype.invokeTask@
> http://localhost:4200/vendor.bundle.js:97854:21
> Zone.prototype.runTask@http://localhost:4200/vendor.bundle.js:97744:28
> drainMicroTaskQueue@http://localhost:4200/vendor.bundle.js:97991:25
> ZoneTask/this.invoke@http://localhost:4200/vendor.bundle.js:97929:25
>   vendor.bundle.js:59774:13
>
> Unhandled Promise rejection: Object { _body: error, status: 0, ok: false, 
> statusText: "", headers: Object, type: 3, url: null } ; Zone: angular ; 
> Task: Promise.then ; Value: Object { _body: error, status: 0, ok: false, 
> statusText: "", headers: Object, type: 3, url: null } undefined  
> vendor.bundle.js:97978:13
>
> Error: Uncaught (in promise): Response with status: 0  for URL: null
> Stack trace:
> resolvePromise@http://localhost:4200/vendor.bundle.js:98058:31
> resolvePromise@http://localhost:4200/vendor.bundle.js:98043:17
> scheduleResolveOrReject/<@http://localhost:4200/vendor.bundle.js:98092:17
> ZoneDelegate.prototype.invokeTask@
> http://localhost:4200/vendor.bundle.js:97855:21
> NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvokeTask@
> http://localhost:4200/vendor.bundle.js:31513:28
> ZoneDelegate.prototype.invokeTask@
> http://localhost:4200/vendor.bundle.js:97854:21
> Zone.prototype.runTask@http://localhost:4200/vendor.bundle.js:97744:28
> drainMicroTaskQueue@http://localhost:4200/vendor.bundle.js:97991:25
> ZoneTask/this.invoke@http://localhost:4200/vendor.bundle.js:97929:25
>
> Here is the code in the service module. Note that the second log message 
> does not show.
>
>   getHeroes(): Promise<Hero[]> {
>   const url = `${this.heroesUrl}?max=15`;
>   console.log("url is " + url)
>     return this.http.get(url)
>                .toPromise()
>                .then(response => { console.log("response is " + 
> response.json()); response.json() as Hero[] } )
>                .catch(this.handleError);
>   }
>  
>
> Regards,
> John
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to