From 68332509ea3e7206620c8cc73fc85955080088a7 Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Thu, 22 Feb 2024 23:18:13 +0100 Subject: [PATCH] fixes #sabi-113 (#152) (#153) fixes sabi-113 HTTP.500 after login (returned users) --- CHANGELOG.md | 5 ++ sabi-webclient/pom.xml | 40 ++----------- .../sabi/webclient/CDIBeans/UserSession.java | 24 +++++++- .../sabi/webclient/config/AppConfig.java | 2 +- .../webclient/config/WebSecurityConfig.java | 18 ++++-- .../controller/MeasurementListView.java | 7 ++- .../sabi/webclient/controller/MenuView.java | 8 ++- .../controller/MyErrorController.java | 45 ++++++++++++++ .../controller/PasswordForgottenView.java | 28 ++++----- .../sabi/webclient/controller/PlagueView.java | 7 ++- .../controller/RegistrationView.java | 21 ++++--- .../sabi/webclient/controller/ReportView.java | 11 ++-- .../webclient/controller/TankListView.java | 14 ++--- .../webclient/controller/UserProfileView.java | 9 +-- .../CustomExceptionHandlerFilter.java | 59 +++++++++++++++++++ .../sabi/webclient/utils/PageRegister.java | 32 ++++++++++ .../resources/META-INF/resources/login.xhtml | 39 ++++++------ .../resources/static/{ => error}/404.html | 7 ++- .../META-INF/resources/static/error/500.html | 49 +++++++++++++++ .../resources/static/{ => error}/error.html | 13 ++-- .../resources/template/masterLayout.xhtml | 14 +++-- .../src/main/resources/application.yml | 2 + .../src/main/resources/log4j2-spring.xml | 4 +- .../src/main/resources/static/error/404.html | 41 +++++++++++++ .../src/main/resources/static/error/500.html | 49 +++++++++++++++ .../main/resources/static/error/error.html | 46 +++++++++++++++ 26 files changed, 470 insertions(+), 124 deletions(-) create mode 100644 sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/controller/MyErrorController.java create mode 100644 sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/security/CustomExceptionHandlerFilter.java create mode 100644 sabi-webclient/src/main/java/de/bluewhale/sabi/webclient/utils/PageRegister.java rename sabi-webclient/src/main/resources/META-INF/resources/static/{ => error}/404.html (82%) create mode 100644 sabi-webclient/src/main/resources/META-INF/resources/static/error/500.html rename sabi-webclient/src/main/resources/META-INF/resources/static/{ => error}/error.html (69%) create mode 100644 sabi-webclient/src/main/resources/static/error/404.html create mode 100644 sabi-webclient/src/main/resources/static/error/500.html create mode 100644 sabi-webclient/src/main/resources/static/error/error.html diff --git a/CHANGELOG.md b/CHANGELOG.md index 6fd25615..7f93c3c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # History of changes (since 5/2022) +## Release 1.2.5 + +### Bugfixes +* HTTP.500 in some cases for returing users with timedout session (sabi-113) + ## Release 1.2.4 ### Bugfixes diff --git a/sabi-webclient/pom.xml b/sabi-webclient/pom.xml index 1ba35b51..bc9e1d99 100644 --- a/sabi-webclient/pom.xml +++ b/sabi-webclient/pom.xml @@ -10,7 +10,7 @@ de.bluewhale sabi-webclient - 1.2.4 + 1.2.5 jar sabi-webclient A JSF based webclient for sabi. @@ -47,7 +47,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.7 + 3.2.2 @@ -57,8 +57,8 @@ 21 2.20.0 4.0.1 - 1.12.2 - 5.1.4 + 1.12.3 + 5.2.2 1.2.5 1.6.4 9.0.9 @@ -107,11 +107,6 @@ - - org.springframework.boot - spring-boot-starter-validation - - org.springframework.boot spring-boot-starter-log4j2 @@ -215,22 +210,6 @@ sabi-webclient - - - - org.joinfaces - joinfaces-maven-plugin - ${joinfaces.version} - - - - classpath-scan - - - - - - @@ -276,17 +255,6 @@ - - - org.joinfaces - joinfaces-maven-plugin - - @@ -13,7 +13,10 @@ xmlns:f="http://xmlns.jcp.org/jsf/core"> - + @@ -33,7 +36,7 @@ - @@ -7,14 +7,15 @@ Ups.. +

Ups...404 file not found

- +
- +
ClibanariusClibanarius crap

Do we have a broken file link? diff --git a/sabi-webclient/src/main/resources/META-INF/resources/static/error/500.html b/sabi-webclient/src/main/resources/META-INF/resources/static/error/500.html new file mode 100644 index 00000000..5179fc2a --- /dev/null +++ b/sabi-webclient/src/main/resources/META-INF/resources/static/error/500.html @@ -0,0 +1,49 @@ + + + + + + Ups.. + + + +

Ups...500 internal error

+ + + + + + + +
Clibanarius crap +

+ Sorry, there was an unplanned error. +

+

+ Currently there is one known issue with returning users + which was raised already here. + This is currently caused with a broken client side view state due to a server redeployment. +

+

Unfortunate this problem has nit been solved yet. + The workaround is to re-login by going into browsers URL field and remove everything after the last "/" and hit enter again. +

+ +

+ Just in case the problem has not been solved by the workaround: + YOU can still help! If you can reproduce the error please submit a trouble ticket with detail description what happened + and led to the problem at: projects Issues + tracker.
+ Before open an own ticket, have a look if some other already reported a problem and leave a comment + there instead. +

+

+ Thanks for supporting the project and sorry for any inconvenience caused. +

+
+ + + + \ No newline at end of file diff --git a/sabi-webclient/src/main/resources/META-INF/resources/static/error.html b/sabi-webclient/src/main/resources/META-INF/resources/static/error/error.html similarity index 69% rename from sabi-webclient/src/main/resources/META-INF/resources/static/error.html rename to sabi-webclient/src/main/resources/META-INF/resources/static/error/error.html index dd79e5ae..bd474116 100644 --- a/sabi-webclient/src/main/resources/META-INF/resources/static/error.html +++ b/sabi-webclient/src/main/resources/META-INF/resources/static/error/error.html @@ -1,5 +1,5 @@ @@ -7,18 +7,22 @@ Ups.. + -

Ups...something went wrong with Sabis Frontend

+

Ups...something went wrong with Sabis' Frontend

- +
- +
ClibanariusClibanarius crap

Sorry for that, but no reason to worry ;-)
+
Some exception in the frontend logic occurred I probably haven't considered yet. + Please try again: https://sabi-project.net/ and if that doesn't fix it + consider the suggested feedback in the next paragraph.

@@ -29,6 +33,7 @@

Ups...something went wrong with Sabis Frontend

Before open an own ticket, have a look if some other already reported a problem and leave a comment there instead.

+

Thanks for supporting the project and sorry for any inconvenience caused.

diff --git a/sabi-webclient/src/main/resources/META-INF/resources/template/masterLayout.xhtml b/sabi-webclient/src/main/resources/META-INF/resources/template/masterLayout.xhtml index f3abcb22..bf1f1d02 100644 --- a/sabi-webclient/src/main/resources/META-INF/resources/template/masterLayout.xhtml +++ b/sabi-webclient/src/main/resources/META-INF/resources/template/masterLayout.xhtml @@ -1,6 +1,6 @@ @@ -30,9 +30,15 @@ - -
Sorry content is missing. Report to site owner.
- + +
+ Sorry content is missing. Report to site owner. +
+
\ No newline at end of file diff --git a/sabi-webclient/src/main/resources/application.yml b/sabi-webclient/src/main/resources/application.yml index ef2a7d02..ad56b5de 100644 --- a/sabi-webclient/src/main/resources/application.yml +++ b/sabi-webclient/src/main/resources/application.yml @@ -41,6 +41,8 @@ server: error: whitelabel: enabled: false + # This will cause error occuring in DsipatcherServlet Context to be routed through the Controller listening on the /error Endpoint + path: /error servlet: session: # dev. setting for sessionExpired diff --git a/sabi-webclient/src/main/resources/log4j2-spring.xml b/sabi-webclient/src/main/resources/log4j2-spring.xml index 6c9e1f39..fef89177 100644 --- a/sabi-webclient/src/main/resources/log4j2-spring.xml +++ b/sabi-webclient/src/main/resources/log4j2-spring.xml @@ -1,7 +1,7 @@ @@ -36,7 +36,7 @@ - + \ No newline at end of file diff --git a/sabi-webclient/src/main/resources/static/error/404.html b/sabi-webclient/src/main/resources/static/error/404.html new file mode 100644 index 00000000..d4e6b5f7 --- /dev/null +++ b/sabi-webclient/src/main/resources/static/error/404.html @@ -0,0 +1,41 @@ + + + + + + Ups..๐Ÿ™ˆ + + + +

Ups...404 file not found

+ + + + + + + +
Clibanarius crap +

+ Do we have a broken file link? +

+ +

+ Good news is: YOU can help! First wait a while and try again. + If you can reproduce the error please submit a trouble ticket with detail description what happened + and led to the problem at: projects Issues + tracker.
+ Before open an own ticket, have a look if some other already reported a problem and leave a comment + there instead. +

+

+ Thanks for supporting the project and sorry for any inconvenience caused. +

+
+ + + + \ No newline at end of file diff --git a/sabi-webclient/src/main/resources/static/error/500.html b/sabi-webclient/src/main/resources/static/error/500.html new file mode 100644 index 00000000..21c5f936 --- /dev/null +++ b/sabi-webclient/src/main/resources/static/error/500.html @@ -0,0 +1,49 @@ + + + + + + Ups..๐Ÿ™ˆ + + + +

Ups...500 internal error

+ + + + + + + +
Clibanarius crap +

+ Sorry, there was an unplanned error. +

+

+ Currently there is one known issue with returning users + which was raised already here. + This is currently caused with a broken client side view state due to a server redeployment. +

+

Unfortunate this problem has nit been solved yet. + The workaround is to re-login by going into browsers URL field and remove everything after the last "/" and hit enter again. +

+ +

+ Just in case the problem has not been solved by the workaround: + YOU can still help! If you can reproduce the error please submit a trouble ticket with detail description what happened + and led to the problem at: projects Issues + tracker.
+ Before open an own ticket, have a look if some other already reported a problem and leave a comment + there instead. +

+

+ Thanks for supporting the project and sorry for any inconvenience caused. +

+
+ + + + \ No newline at end of file diff --git a/sabi-webclient/src/main/resources/static/error/error.html b/sabi-webclient/src/main/resources/static/error/error.html new file mode 100644 index 00000000..f98b77c2 --- /dev/null +++ b/sabi-webclient/src/main/resources/static/error/error.html @@ -0,0 +1,46 @@ + + + + + + Ups..๐Ÿ™ˆ + + + +

Ups...something went wrong with Sabis' Frontend

+ + + + + + + +
Clibanarius crap +

+ Sorry for that, but no reason to worry ;-)
+
+ Some exception in the frontend logic occurred I probably haven't considered yet. + Please try again: https://sabi-project.net/ and if that doesn't fix it + consider the suggested feedback in the next paragraph. +

+ +

+ Good news is: YOU can help! First wait a while and try again. + If you can reproduce the error please submit a trouble ticket with detail description what happened + and led to the problem at: projects Issues + tracker.
+ Before open an own ticket, have a look if some other already reported a problem and leave a comment + there instead. +

+ +

+ Thanks for supporting the project and sorry for any inconvenience caused. +

+
+ + + + \ No newline at end of file