Creating a maintenance thread in Spring

Recently we needed to reindex our data due to some changes. Here is how we did it. We defined a file on the file system. If that file is present the reindexing thread runs, so it would easy for our deployment team to run reindexing when needed. Here is the code creating the thread.  So … [Read more…]

Enums saved to database. How

Recently we ended up in an issue with enums. One of the developers changed the order of enums because of a change he had to do. And he thought that enum values that are logically together should be put together in enum class also. But when he was done with the change, all the tests … [Read more…]

Tomcat logs not showing correct time

We upgraded from Java 1.8 to openjdk 16. And among many other issues that we have been struggling with for the past 3 weeks, we saw unusual behavior in tomcat. After deploying the webapp, we found that dates in the database were changed and logged GMT time instead of normal UTC time that is our … [Read more…]

No Logs generated for hibernate when using log4j, slf4j and jcl jars

Recently we faced an issue while upgrading to the latest version 5.0.1 for poi. And we ended up having following jars for logging all logs to log4j log4j-slf4j-impl-2.14.0.jar jcl-over-slf4j-1.7.30.jar slf4j-api-1.7.30.jar log4j-api-2.14.0.jar log4j-core-2.14.0.jar log4j-web-2.14.0.jar We use hibernate in our web application. And hibernate needs slf4j for logging.  With our update the hibernate logs are no more … [Read more…]

java.lang.UnsatisfiedLinkError: /openjdk/lib/libawt_xawt.so: libXtst.so.6: cannot open shared object file:

Recently we were working with apache poi. And we switched to openjdk16 from oracle java 1.8.  On our test server we started seeing the following error: java.lang.UnsatisfiedLinkError: /openjdk/lib/libawt_xawt.so: libXtst.so.6: cannot open shared object file:  So looking at the error we saw that  ls -l /openjdk/lib/libawt_xawt.so was listing the file. So the file was there. And … [Read more…]