Java

java.lang.ClassNotFoundException: javax.annotation.PostConstruct

When upgrading to the latest tools and libraries in a Spring Boot application with OpenAPI code generator in place the OpenAPI Kotlin generator introduced jakarta.annotation:jakarta.annotation-api. But with this in place the application refused to start with something like org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat…Caused by: java.lang.IllegalStateException: …

java.lang.ClassNotFoundException: javax.annotation.PostConstruct Read More »

Lombok and log4shell

Project lombok has become a defacto standard in close to every Java project I see. Because of this I want to also write about the ongoing log4j problems as described under https://blog.coffeebeans.at/archives/1709. The annotation @Log4j allows to create a log4j logger field in the annotated class. This of course implicates that your project is using …

Lombok and log4shell Read More »

gradle status plugin

I’ve started to write a simple plugin to analyse gradle projects and send dependency information to a central server. This way I want to get insight into all projects in the company and check if there is some log4j2 dependency below 2.16.0. You can find the code under https://github.com/mbogner/gradle-status-plugin. The plugin was accepted and is …

gradle status plugin Read More »

Spring Boot log MDC

Spring Boot contains a quite nice configuration for logback with color coding and good readability. But it lacks logging MDC (Mapped Diagnostic Context) content. I tried around and found a way to append MDC to every logged line by setting the console pattern in my application.properties/yml under logging.pattern.console to Without any MDC set this adds …

Spring Boot log MDC Read More »

Spring Boot Hibernate 2nd level cache with ehcache next to spring-cache with gradle build

It’s quite easy to mix up spring-boot-start-cache with 2nd level caching in hibernate. In this post I want to take down how to enable both and being able to run tests from within intellij and gradle (which isn’t the default if you just follow most tutorials). To have proper dependencies for this i added the …

Spring Boot Hibernate 2nd level cache with ehcache next to spring-cache with gradle build Read More »

JAVA_HOME in openSUSE 13.2

In openSUSE 13.2 JAVA_HOME is set to default OpenJDK JRE. This can be changed in the file /etc/profile.d/alljava.sh. Just place your jdk-installation directory in front of the listed directories in the first for loop.

hibernate.id.new_generator_mappings

“true or false. Setting which indicates whether or not the new IdentifierGenerator implementations are used for AUTO, TABLE and SEQUENCE. Default to false to keep backward compatibility. Note We recommend all new projects to use hibernate.id.new_generator_mappings=true as the new generators are more efficient and closer to the JPA 2 specification semantic. However they are not …

hibernate.id.new_generator_mappings Read More »