How to schedule a task in Java?
In Java scheduling a task to run on fix intervals is quite simple. Here is the code to create a scheduler
Java is a high-level, class-based, object-oriented programming language.
In Java scheduling a task to run on fix intervals is quite simple. Here is the code to create a scheduler
We switched from java 1.8 to openjdk 16. And we were faced with builds running on jdk1.8 and jdk16 simultaneously for a short period. And the test didn’t run. So we had to pass arguments to surefire based on jdk the build was running. So we did it with a property whose value gets set … Read more
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
Load the property File Now get the Integer Value from the loaded property File
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
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
Problem : Eclipse :the input type of launch configuration does not exist Solution : I had created a Test class with a different file name than the name of the class itself. File Name : Test1.java And the contents were : class Test{ } On running this test in eclipse I … Read more
Problem : java.lang.IllegalStateException: Unrecoverable indexation failures: 1 errors among 1 requests SonarQube sometimes fails to upload the sonar analysis results with the exception java.lang.IllegalStateException: Unrecoverable indexation failures: 1 errors among 1 requests Cause : Most probably the disk is full on the sonar hosting server. Solution: Solution is simply to clean up the disk space … Read more
While running TestNg Tests if you see the below error Caused by: org.testng.TestNGException: Cannot find class in classpath: com.* The most common mistake is that you have defined the package as a class in testng.xml and not the package. The correct way to include all classes in a package like below: <!DOCTYPE suite SYSTEM … Read more
Problem: 03-May-2021 19:15:28.056 SEVERE [ajp-nio-9209-exec-4] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [com.sun.xml.ws.transport.http.servlet.WSServletContextListener]java.lang.ClassNotFoundException: com.sun.xml.ws.transport.http.servlet.WSServletContextListener Cause : jaxws-rt.jar is either missing or has multiple versions. Solution 1: If you don’t have this jar add it to tomcat/lib folder. Solution 2: For maven, you can add the dependency in your pom.xml. Make sure to pick … Read more