while upgrading from Spring Boot 2.6.4 to 2.6.6 , one of my tests (written in Kotlin), fails : the build passes with Spring Boot 2.6.4. It works in Spring Boot 2.6.6 when I run the test individually in my IDE, but fails during the maven build. the stacktrace was not showing by default, but after surrounding the call by a
Tag: spring-boot
post method not supported in patch method
I want edit entity with validating by hibernate-validator, but when calling the patch method, an error is thrown: post method not supported. How to make @PatchMapping work correctly? I am a beginner developer, help me please. Controller: Service: Repository: html form: Answer you can not use ‘PATCH’ for the form method attribute. only ‘GET’ and ‘POST’ methods are allowed(source).
An APRI REST http request goes in 404
I am new with SpringBoot, and API REST, i used to develop in a Struts MVC SOAP project. When i try to run an API REST on a browser or with curl it goes in 404. here is my projec, the ide that I am using is IntelliJ IDEA 2021.3.3 (Community Edition): info about the ide pom.xml Controller The Object
how do i save a new student that contains entities, but don’t create these entities because they already exist in the database?
I want to save a student and a student has a TargetAudience object as an attribute. These target audiences are allready hardcoded in my database. (targetaudience = campus + major). Now when i post like this: it doesnt work because everythime it creates a new object for the campus and because i use name as a primary key it throws
How to copy object that has a list with BeanUtils?
I’m working on a multi maven modules and I want to copy from entity to model with BeanUtils, here what I tried: This is my entity (with getters/setter/noargs/allargs): and this is my model (DTO Model): This is the output I’m getting: The problem is that the fields get copied but the list does not it shows me an empty List.
How can I use more then one param in a spring boot rest Controller?
I want to achive the follwing URL to access my data with 2 params: http://localhost:8080/contactnote?entryDate=2022-02-01?contactType=T Both mappings with a single param is working: But when I try to combine them with two params it wont work, not one of them is usable. My reposiitory looks like this: Answer the URL you entered is invalid, double ?, you have to use
Java SpringBoot – Endpoint to trigger a job moments after, but returns immediately
Small Java and SpringBoot question please. I would like to build an endpoint, which when a client calls in, will return immediately, but after a minute from the call, will trigger a job. I have no control over when the client triggers the requests, I cannot hold the client for that time, and I have no control over the client
Spring Boot @RestController @Autowired null in Unit tests
I can’t understand why @Autowiring my @RestController class is returning null. I want to do a basic unit test before doing an integrated test but its failing. In fact anything that is being @Autowired is showing null in the test package. I have a very simple test, I just want to see the basic works: A very simple example: And
How to add @RestController to spring-webflux apps?
The annotation @RestController cannot be resolved when only adding spring-boot-starter-webflux as maven dependency: pom.xml: What is missing here? According to many resources out there (eg https://medium.com/javarevisited/basic-introduction-to-spring-webflux-eb155f501b17), the webflux dependency should be sufficient for a webflux-webservice in spring-boot. Answer RestController annotation is part of org.springframework:spring-web: dependency org.springframework:spring-web dependency is part of org.springframework.boot:spring-boot-starter-webflux jar so it should get resolved. You can check
FileNotFoundException in SpringBoot when running in Docker Container
My Springboot Application is running fine in IDE but when I create fat jar file and run on docker it gives the error. I am connecting my application with firebase so i want to include the serviceAccountKey.json file from the resource folder. The application runs fine in my ide, but while deploying it over the docker container it gives the