on ‎2019 Apr 03 10:35 AM
Hybris 18.08.3 is running on a cluster. One of the nodes is dedicated to background jobs and is not exposed publicly for visitors. Most cron jobs are running on that node. Lately, often (not always) after restarting this background node, following exception gets thrown: NPE stack trace
After that some classes become inaccessible - lots of NoClassDefFoundError, for example: NoClassDefFoundError example
Rebuild/restart helps, but only in roughly 70% of cases. Sometimes we have to restart the server several times before NoClassDefFoundError disappear.
What specifically could cause it and how could it be mitigated?
Any help is very much appreciated.
UPDATE 2020-06-03: Workaround found
We have discovered that if we disable the frequently running backoffice index cron job (which runs every minute) during server startup, then the mentioned error does not happen. After server fully starts up, then we can re-enable the job, and it runs normally.
Our current guess is that because of high frequency of this job, it tries to run too early, while the server has not completely started up. So the job might try to use some classes before those classes are loaded. And if the first failed attempt to load those classes fails, then future attempts also fail (still not sure what exact mechanism is responsible for that).
Request clarification before answering.
An elegant workaround was discovered:
task.polling.startup.delay.enabled=true
From SAP docs:
Postponing Database Polling
Platform may start to poll the database to retrieve tasks during Tomcat startup even when not all servlet contexts are initialized. To postpone polling the database for tasks until all servlet contexts are started, set the task.polling.startup.delay.enabled property to true. The default value of this property is false.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.