0

In my application developed in angular 8 and Rest API, I have a call that takes a long time than usual (> 10 minutes or more) in uploading certain documents.

But I can see in my browser's network that after 4 minutes my request gets canceled automatically and in my backend below error comes:

Servlet.service() for servlet javax.ws.rs.core.Application threw exception: java.lang.IllegalSta teException

In angular I tried below code but did'nt work out, I am using post end point:

this.httpClient.post(endpoint, formData, { params: payload }).pipe(timeout(36000000)).subscribe((response: boolean) => {

My questions: 1. Is this timeout happening from the angular side or restapi side? 2. How can I handle it?

In Rest api web.xml, I have below entry:

<session-config>
    <session-timeout>60</session-timeout>
</session-config>

Please help for the same.

Vikas
  • 11,859
  • 7
  • 45
  • 69
hunnyGeek
  • 31
  • 4
  • Are you using proxy config? (https://angular.io/guide/build#proxying-to-a-backend-server) – Terry May 04 '20 at 07:06
  • Which browser are you using? It may be a browser specific setting. See here: https://stackoverflow.com/q/1342310/6513921 – ruth May 04 '20 at 07:34
  • Yes, "/api/rest": { "target": "http://localhost:8180", "secure": false, "changeOrigin": true, "logLevel": "debug", "headers": { "channel": "intranet" } – hunnyGeek May 04 '20 at 07:36
  • Google Chrome. Is this related to browser timeout setting? – hunnyGeek May 04 '20 at 07:44

0 Answers0