Thymeleaf throwing NPE unpredictable

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Thymeleaf throwing NPE unpredictable

rashid301
I have a Spring project with Thymeleaf. CategoryController adds "category" object to the spring model. Category has a name field with getters and setters.

The Controller and View works fine for sometime. Everything renders without any issue. However, after about a day, suddenly thymeleaf cannot find name field on the category. At this point, the only way to recover seems is to clear the /tmp/ folder and restart tomcat.

Please note that this issue happens with only this Controller and the "category" object. Other controllers and other model objects continue to render properly.

I have added logs and checked that Controller sets non null category on the model all the time and yet suddenly thymeleaf starts throwing NPE. The fact that clearing /tmp/ folder and restarting application "fixes" this, it seems to be some cache corruption. But I cannot figure out the exact problem.

How do I fix this?
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf throwing NPE unpredictable

rashid301
Does anyone have any suggestions for this? Having to restart server everyday is becoming a problem. Any guidance would be appreciated.