0

I have a JSF application running on a Glassfish server. On pressing a commandButton the program loads some data from the database and manipulates it using an algorithm. The process could take 10 minutes or much longer depending on the amount of data. Whilst the algorithm is running I keep the JSF webpage open ( the page is called runAlgoritm and it utilises a session scoped bean), but after a couple of minutes I get an error message in netbeans

I have Googled the error message and cannot find anything relevant but my guess is it is it some type of session timeout. I have changed the timeout in web.XML and I think I have changed the timeout for Bean timeout in Glassfish (the instructions I found were not very good but neither have made a difference.The image of the error is below but it says Cannot open http:/localhost ..... where .... is the relevant page and location (note the page is still open in the browser.

enter image description here

I did think that the error may be in my code but when I run smaller problem sets it works fine.

Does anyone have any ideas? I could redirect to the webpage but I would rather keep them on the runAlgorithm page until the results are ready.

thanks for your help

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
  • Don't do this work synchronous – Kukeltje Jul 21 '18 at 19:56
  • Possible duplicate of [Calling a long running process asynchronously on a button click in JSF](https://stackoverflow.com/questions/31872441/calling-a-long-running-process-asynchronously-on-a-button-click-in-jsf) – Kukeltje Jul 21 '18 at 19:56
  • Kukeltje Hi is it possible to use async method in jsf ? or do I need to use a ejb? – Richard Faint Jul 22 '18 at 07:22
  • Search the internet. https://stackoverflow.com/questions/6149919/is-it-safe-to-start-a-new-thread-in-a-jsf-managed-bean – Kukeltje Jul 22 '18 at 09:56
  • From reading it seems I need to use a EJB. I tried to find a tutorial but cannot find one, can you point me in the right direction – Richard Faint Jul 22 '18 at 14:15
  • In the link of my previous comment the ScheduledExecutorService is mentioned. It also mentioned in other related/linked Q/A ('See also') just check them. – Kukeltje Jul 22 '18 at 14:35

0 Answers0