Category "spring-boot"

How to define default null value in application.yml in Spring Boot

I'm trying to define the default value as null value in application.yml with SpringBoot version 1.3.0.RELEASE. The goal is be able to refer it with a class with

MapStruct not autowiring with Kotlin and Spring Boot, built using Gradle

I have the following parts in my gradle file: apply plugin: 'kotlin-kapt' ... compile("org.mapstruct:mapstruct:1.3.0.Final") kapt("org.mapstruct:mapstr

Spring Boot can't autowire @ConfigurationProperties

Here is my FileStorageProperties class: @Data @ConfigurationProperties(prefix = "file") public class FileStorageProperties { private String uploadDir

Programmatically call spring cloud config actuator/env post endpoint in spring boot application

I am using spring cloud config in my spring boot application, I am trying to update the property value through actuator/env post endpoint. Here is my code: @Ser

Facing NoSuchMethodError and NoClassDefFoundError after Spring boot upgrade from 2.4.x to 2.5.x

Error logged while running gradle clean build: java.lang.Exception: Unexpected exception, expected<org.springframework.web.client.HttpClientErrorException>

Authentication Manager Builder in Spring Security

I was exploring spring security and tried to build a small application wherein I have a an entity name User and a userRepository having a one declared method fi

How to write Unit Test for below Exception Handler method using mockito?

@ExceptionHandler({ ConstraintViolationException.class }) public ResponseEntity<Object> handleConstraintViolation(ConstraintViolationException ex, WebRequ

What is the purpose of AuthenticationEntryPoint in Spring Web Security?

What is the purpose of AuthenticationEntryPoint in Spring Web Security? The documentation does not provide much details. When should this be used, and does it

No implementation was created for Mapper due to having a problem in the erroneous element

I'm trying to use Mapstruct to map my classes in a spring boot project. My dependencies : <?xml version="1.0" encoding="UTF-8"?> <project xmlns="ht

Parameter 0 of constructor in 'Controller' required a bean of type 'service' that could not be found. Not working: adding annotations, componentscans

I'm trying to use Services and DTOs in my project (trying to learn what they are and how they should be used). First, I had only Controllers, Models and Reposit

Using Liquibase to initialize in-memory H2 for unit tests in Spring Boot application

I've used in-mem databases in Spring JPA tests many times, and never had a problem. This time, I have a bit more complex schema to initialize, and that schema m

Adding .crt to Spring Boot to enable SSL

I have never done this before, and most of the tutorials do not mention how to deal with .crt files. I bought an SSL certificate from GoDaddy, and selected To

specify files in resources folder in spring application.properties file

I have a Spring Boot application, the code need to access a file under resources folder. here is my application.properties file: cert.file=classpath:/resources

Access-Control-Allow-Origin multiple values with Spring Boot and Vue.JS

I have this class for CORS on my API: import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annota

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: FQPropretyName, could not initialize proxy - no Session

I am trying a ManyToOne Bi-Directional Association using SpringBoot, SpringDataJpa along with a unit test using SpringBootTest. However the test fails with the

Externalising Spring Boot properties when deploying to Docker

In my Spring Boot app I want to externalise the properties to run in a Docker container. When first deployed, the properties that are currently in my-server/sr

'mvnw' is not recognized as an internal or external command

I am getting the following, while running 'mvnw' command. How to add maven wrapper to a project? project_root>mvnw 'mvnw' is not recognized as an inter

spring boot application in docker terminates immediately

Simple spring boot application trying to run in docker, however after docker run, exits immediately. Here is my Dockerfile FROM anapsix/alpine-java:latest VOLU

Spring Boot, ClassNotDef Error with JaxB, Package -Info.java

I am using AJSC framework in SpringBoot with JaxB implementation. I built the stubs outside the project and copied them inside the project with proper directori

This application has no explicit mapping for /error bad request 400

I have a small spring boot project,, which works fine . But, I tried to add some kind of validation.. I worked on one html page but failed on the other with no