cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Backoffice context occasionally fails to startup: NullPointerException at DomLoader.java:134

pavelska
Explorer
0 Likes
1,171

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).

Accepted Solutions (0)

Answers (1)

Answers (1)

pavelska
Explorer

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.

Source: https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/1808/en-US/7946d61720754981887ba63af9d8...

pavelska
Explorer
0 Likes

Update: turns out that this solution does not solve the problem - it still keeps happening from time to time.