I’m trying to use spring cloud stream to solve the following problem: I have a class that calls two separated functions (Function A and B), both of those functions must work in parallel if the Function A finishes it must call the Function C, the same happens if Function B finish but this will call Funct…
Tag: spring
Create custom finder with spring
I trying to implement a database with a many-to-many relationship.The database has been built, now we need queries to it. I’m using this article as an example: https://www.bezkoder.com/jpa-many-to-many/. When I create custom finder in Repository – server crushes at running. I have two Entity: Mass…
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 p…
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 …
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 t…
Using AOP and DI itself causes Spring ApplicationListener to be fired twice
Software versions Spring Version 5.3.18 and earlier JDK Version 1.8.0_202 Overview When I use Spring ApplicationListener, in order to prevent transaction invalidation, my ApplicationListener implementation class writes the following code (of course, the code can be written differently to avoid this problem), …
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 suf…
How can I connect a Python websocket client to my Spring endpoint?
I’m new to Python and I’m trying to connect to a service that I currently have up running in Spring. On the server-side I have a custom Handshake handler in place by extending DefaultHandshakeHandler and overriding the determineUser method, where I then extract the user information. However, when …
How to upgrade spring framework version in spring boot
I am using spring-boot 2.3.3.RELEASE with the according spring-boot-starter-parent in maven. Due to the spring4shell CVE I wanted to upgrade the spring-framework to 5.2.20.RELEASE instead of the already included 5.2.8.RELEASE. I tried overriding the spring-framework.version property from spring-boot-dependenc…