Tag Java

Workaround for missing DomainClassConverter in Spring Boot JUnit tests

In one of my projects I let Spring Boot automatically bind domain objects from the database.

This fails in the reduced unit test setup, because DomainClassConverter is not available. But it can be mocked!

weiterlesen

Formatting phone numbers using libphonenumber in Thymeleaf

The Google phone number parser & formatter is very helpful to ensure the same number format for user prodived data. To simplify the use in Spring Boot application with Thymeleaf I created a wrapping TagLib/ExpressionFactory.

weiterlesen

How to ensure you get a BindingResult instead of whitelabel error page when validating input

When I started to use Spring Boot I had some issues with the validation. The @Validated annotation triggered the validation as requested but the validation terminated with an org.springframework.validation.BindException instead of filling the BindingResult object.

weiterlesen

Configure Java/JDBC to connect to PostgreSQL with JRE certificate validation

Using the PostgreSQL JDBC driver since 42.2.5, the SSL behaviour changed which can cause FileNotFoundExceptions looking for .postgresql/root.crt.

weiterlesen

How to find the cause of "deleted object would be re-saved by cascade"

Sometimes if you do not properly delete objects in a Grails/GORM/Hibernate transaction the following error might occur:

deleted object would be re-saved by cascade (remove deleted object from associations)

This message is presented by the org.hibernate.ObjectDeletedException

After some hours of investigation I found a solution to find the cause!

weiterlesen

BASIC Auth with Oracle WebLogic

If you would like to do the authentification in Java application running on Oracle WebLogic, you will probably wonder why the Authentification-Header does not reach the Filter.

weiterlesen

Logstash Log4j broken pipe with MDC attributes

We recently configured some applications to log with log4j's SocketAppender to Logstash.

When we startet to add MDC-Attributes we sometimes lost the connection:

| Error log4j:WARN Detected problem with connection: java.net.SocketException: (broken pipe)

weiterlesen

Bewässerungsanlage mit Raspberry Pi

Um im Sommer Pflanzen nicht zu vernachlässigen habe ich das das Projekt einer automatischen Bewässerungsanlage gestartet... als Testumgebung nutze ich den Topf mit den Kräutern.

weiterlesen

Stehpult vom Computer aus steuern

Ein Stehpult ist ja schön und gut, aber ohne Verbindung zum Computer ist das doch langweilig...

weiterlesen

© 2015 - 2022 Moritz Kobel

Theme by Anders NorenUp ↑