-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix NoClassDefFoundError when opening notifications #7556
Fix NoClassDefFoundError when opening notifications #7556
Conversation
Suggested tests to cover this Pull Request
|
@HoussemNasri can you rebase this branch on top of current master. I think some of the SonarCloud errors will go away. |
86ac473
to
f15265b
Compare
SonarCloud is not complaining anymore, but one cucumber test failed. |
That is a known race condition. I rerun the test. Likely it will succeed this time. |
@mcalmer Rerunning did the job, all checks have passed now. Any other changes to add to the PR? |
master branch is currently "blocked" as we try to release uyuni 2023.09. As soon as it is opened again, I can merge this. |
What does this PR change?
The problem is that
Class#forName
can throw aLinkageError
orExceptionInInitializerError
which wouldn't be caught by the current catch statement. Eventually, sinceconfigureMailer()
is called during class initialization, the exception will be caught by the classloader and translated intoNoClassDefFoundError
. However, I still don't know why exactly an Error was thrown in the first place nor I can reproduce the other behaviors reported like the WebUI not responding.To reproduce, replace the content of
configureMailer()
withthrow new LinkageError();
, and then try to visit the notifications page. In the logs, you'll get a similar exception to what was reported in the linked issue. One difference is that the exception starts fromprepareUserNotifications
notdataUnread
.GUI diff
No difference.
Documentation
No documentation needed.
DONE
Test coverage
No tests.
DONE
Links
Fixes #6918
Changelogs
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run: