Category "spring"

MantToMany - Cannot add or update a child row: a foreign key constraint fails

I am trying to create Many to Many relationship and save some data to database. I have entities: @Data @AllArgsConstructor @NoArgsConstructor @Entity public cla

Is using @CrossOrigin the same as overriding addCorsMapping() in Spring?

In my controller I currently added the following annotation @CrossOrigin: @RestController @RequestMapping(value = "/dev/test") @CrossOrigin publ

Slf4j logger log fields from parent class

I have following code: @Slf4j public class Main { @Data public static class AClass { private String title; } @Data public static class BClass extends ACla

Keycloak login based Authorization and authentication of application user

I am new to keycloak , whether the user creation should be happened in my application or at keycloak

How to call scheduler from Main Class

My application have two schedulers one runs every day at a particular time and another scheduler every day at and interval of 1 hour. I have added the cron exp

Java SpringBoot OpenApi @ApiResponse shows wrong return object

I'm using OpenApi 3 in my SpringBoot project in order to generate a Swagger html page. The dependency in POM.xml : <dependency> <groupId&g

Which mechanism to use for CSRF token handling with spring security

I am new to web security and implementation of same using spring-security. One important concept is prevention from CSRF using CSRF token. Spring security has p

Connect Heroku Add-on MySQL Database to DigitalOcean droplet for Spring Boot

Have anyone deployed Spring Boot app to DigitalOcean droplet? I have previously created app on Heroku.com, where I also ordered MySQL Database and deployed my W

Duplicate tomcat logs

Have spring boot app with only one dependency spring-boot-starter web and want to see tomcat logs for that i added to logging.properties that handlers = 1catali

How to handle reactive types within Reactive Spring Integration?

I'm playing a little with Reactive Spring Integration and I try to perform the following basic operation: @Override protected IntegrationFlowDefinition&

My component scan on Spring 5.3.18 does not work

I have little problem with spring ComponentScan in my application. Here is my Test spring configuration: @Configuration @ComponentScan(basePackages = {"com.dhl.

Spring Mvc integration test fails

I want to write an integration test for a delete method in my controller, but no matter how many times I tried rewriting it, I am still getting different errors

How to check if a player has collided with any wall Java

I am making a maze game and I am trying to implement a wall feature that will restrict the movement of a player if he collides with a wall. I have created a wal

java.lang.NoSuchFieldError: com/fasterxml/jackson/annotation/JsonInclude$Include.USE_DEFAULTS

I am using spring 5.3.7 and when I start my application, it returns the error below: Instantiation of bean failed; nested exception is org.springframework.beans

CucumberBackendException: No qualifying bean of type

When trying to run step defs with abstract class contains all the context configuration spring sees 2 differnt beans parent and stepdef I'm using spring boot ve

What can i do to not re-run gradle spring boot application again and again

I've one gradle spring boot project. Even if i'd to put one log at some place. It requires re-run of the application. Is there anyway to add these type of chang

Why are singleton beans created twice in Spring?

I have a spring-boot project that contains a BookMapper bean: import org.apache.ibatis.annotations.Mapper; @Mapper public interface BookMapper { // some CR

Is there a way to get the EntityManagerFactory on a project that uses Java Spring JPA but doesn't have a "persistence.xml" file?

I want to use the EMF to do queries constructed at runtime on a String. If there is a way I would appreciate it if someone could tell me how and give a small ex

Using zipOutPutStream, cannot change mediatype in exceptionhandler, when exception happens in Spring

In my post request endpoint, I want to generate ZIP File. Here is endpoint: public void downloadZipFile(@RequestBody final Parameters parameter, final HttpServl

Pentaho j_spring_security_check mixed content. HTTPS to HTTP

I have installed Pentaho (9.x) on Tomcat 8.5 and OpenJDK 1.8 as required. In front of it there is Apache 2.4 with mod_proxy_http. My website is served with HTTP