Tag Spring Boot

lokaler Zugriff auf Metriken einer CTA Optiheat 1-11es Wärmepumpe

In unserem Haus steht eine Wärmepumpe des Typs CTA Optiheat 1-11es.

Da wir in der letzten Zeit mit der Temperatur des heissen Trinkwassers nicht zufrieden waren, habe ich mich der Herausforderung gestellt, an Metrikdaten zu kommen.

weiterlesen

java.lang.NullPointerException: Cannot invoke "jdk.internal.platform.CgroupInfo.getMountPoint()" because "anyController" is null

Recently I got an new exception when I started a Spring Boot application for development:

Fatal error: java.lang.NullPointerException: Cannot invoke "jdk.internal.platform.CgroupInfo.getMountPoint()" because "anyController" is null
        at java.base/jdk.internal.platform.cgroupv2.CgroupV2Subsystem.getInstance(CgroupV2Subsystem.java:80)
        at java.base/jdk.internal.platform.CgroupSubsystemFactory.create(CgroupSubsystemFactory.java:114)
        at java.base/jdk.internal.platform.CgroupMetrics.getInstance(CgroupMetrics.java:177)
        at java.base/jdk.internal.platform.SystemMetrics.instance(SystemMetrics.java:29)
        at java.base/jdk.internal.platform.Metrics.systemMetrics(Metrics.java:58)
        at java.base/jdk.internal.platform.Container.metrics(Container.java:43)
        at jdk.management/com.sun.management.internal.OperatingSystemImpl.<init (OperatingSystemImpl.java:182)
        

 

weiterlesen

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

Inject Attributes to Spring Boot Controller Methods (HandlerMethodArgumentResolver)

During learning Spring Boot I noticed attributes to methods in Spring Boot controllers can be automatically injected.

To migrate my blog from Grails to Spring Boot I created an implementation to inject the current blog instance based on an session attribute.

weiterlesen

Asset Pipeline Thymeleaf Taglib

Using the asset pipline in Grails, the production CSS and Javascript files have been including with a digest appendix. This feature is not available in Spring Boot, therefore I started to create a simple Thymeleaf tag library.

weiterlesen

© 2015 - 2022 Moritz Kobel

Theme by Anders NorenUp ↑