MockMvc no longer handles UTF-8 characters with Spring Boot 2.2.0.RELEASE

Yes. This is problem from 2.2.0 spring-boot. They set deprecation for default charset encoding. .getContentAsString(StandardCharsets.UTF_8) – good but in any response would be populated ISO 8859-1 by default. In my project I updated current created converter: @Configuration public class SpringConfig implements WebMvcConfigurer { @Override public void configureMessageConverters(List<HttpMessageConverter<?>> converters) { converters.stream() .filter(converter -> converter instanceof MappingJackson2HttpMessageConverter) … Read more

Spring Boot 2 – Actuator Metrics Endpoint not working

I would like to enhance the OP’s answer with more information as I struggled a bit before finally stumbling upon this solution and there seem to be lots of confusion about changes to actuator behavior with Spring Boot 2 What hasn’t changed You need to include a dependency to spring-boot-starter-actuator <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> … Read more

Spring Boot: autowire beans from library project

Just found the solution. Instead of defining base packages to scan from separate library, I’ve just created configuration class inside this library with whole bunch of annotation and imported it to my main MyApplication.class: package runnableProject.application; import com.myProject.customLibrary.configuration.SharedConfigurationReference.class @SpringBootApplication @Import(SharedConfigurationReference.class) public class MyApplication { public static void main(String[] args) { SpringApplication.run(MyApplication.class, args); } } package … Read more

INFO warnings about multiple modules in Spring Boot, what do they mean?

If you are using redis implementing your own persistence layer, you are not using the interface that extends CrudRepository. That was my case, I just deactivated the redis repositories search and the message below disappeared from my JPA repositories. Spring Data Redis – Could not safely identify store assignment for repository candidate interface To disable … Read more

“httptrace” endpoint of Spring Boot Actuator doesn’t exist anymore with Spring Boot 2.2.0

The functionality has been removed by default in Spring Boot 2.2.0. As a workaround, add this configuration to the Spring environment: management.endpoints.web.exposure.include: httptrace and provide an HttpTraceRepository bean like this: @Configuration // @Profile(“actuator-endpoints”) // if you want: register bean only if profile is set public class HttpTraceActuatorConfiguration { @Bean public HttpTraceRepository httpTraceRepository() { return new … Read more

The AJP Connector is configured with secretRequired=”true” but the secret attribute is either null or “” after upgrade to 2.2.5

Navigate to the server.xml in tomcat: Replace AJP with: <Connector protocol=”AJP/1.3″ address=”::1″ port=”8009″ redirectPort=”8443″ secretRequired=”false” /> But make sure that you understand the security implications of that (see Krzysztof Skrzynecki’s answer for that).

Difference between @EntityScan and @ComponentScan

The @ComponentScan annotation is used to automatically create beans for every class annotated with @Component, @Service, @Controller, @RestController, @Repository, … and adds them to the Spring container (allowing them to be @Autowired). The @EntityScan on the other hand does not create beans as far as I know. It only identifies which classes should be used … Read more