-
Notifications
You must be signed in to change notification settings - Fork 736
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
static initializer of AnalyzerGuru causing hard to detect deployment problems #2027
Comments
vladak
pushed a commit
to vladak/OpenGrok
that referenced
this issue
Feb 26, 2018
Cool, the less singletons the better.
Dne 26. 2. 2018 5:09 odp. napsal uživatel "C Fraire" <
[email protected]>:
… I have a PR queued up: "Refactor AnalyzerGuru, HistoryGuru as
non-singleton" (370bfa3
<370bfa3>),
that addresses this. It's eighth after the current PR #2017
<#2017>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2027 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACzGDHUIcqDBanI0bi1o6bbkNXfjFdUzks5tYtc6gaJpZM4STegC>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After not using my mac mini workstation (running macOS 10.13.3) for a while to run OpenGrok, I decided to give it a try and do a mini project in Netbeans. To my dismay, the webapp could not be loaded. It deployed fine however then got an exception when rendering the index page:
According to https://stackoverflow.com/questions/7325579/java-lang-noclassdeffounderror-could-not-initialize-class-xxx this is caused by code in the static initializer. Indeed, AnalyzerGuru has lots of stuff that can fail in there. I added try/catch block with logging+rethrow there however could not see it anywhere (like https://stackoverflow.com/questions/19999590/tomcat-6-error-in-static-initialiser-is-hidden-by-noclassdeffounderror?noredirect=1&lq=1).
Next, I constructed trivial test case to call
AnalyzerGuru.getfileTypeDescriptions()
to see if the problem surfaces there however to no avail.Next, I commented out most of the stuff in the
analyzers
array and the problem disappeared however after uncommenting them again I cannot reproduce it anymore so either it is transient or depends on other external factors or there has to be some JVM/Tomcat/Netbeans dance performed to refresh thewar
file (I dutifuly did full rebuild, restart, redeploy each time).The text was updated successfully, but these errors were encountered: