Category "spring"

Spring Kafka : Record listener vs Batch listener

With spring-kafka, there is two types of Kafka listeners. Record Listeners : @KafkaListener(groupId = "group1", topics = {"my.topic"}) public void listenSingl

Spring MVC 5 ResultMatcher jsonPath null value

After upgrading my rest service from Spring Boot 1.5.10 to 2.0.0 I encountered my tests failing which passed before. Following Scenario: import org.mockito.in

Need to process multiple files in parallel in Spring Integration

I have a SFTP directory and reading files and sending the files for further processing to a ServiceActivator.At any point I need to process them parallely using

Spring Boot Upgrade from 2.3.x -> 2.6.x Breaks mvc forward:

After upgrading From Spring Boot 2.3.x to 2.6.x Forwarding MVC REST Calls doesn't work. We have a controller for /health that returns forward:/actuator/health/.

Springfox swagger-ui.html unable to infer base URL - Caused by missing cookies

We have our Spring Boot services behind an API Gateway. With an earlier version of Springfox - 2.1.2 we had no issues in loading the swagger-ui.html page. This

BeanCurrentlyInCreationException when @Autowired and @Bean are present in same class

@Configuration public class Test1 { @Autowired private Test3 test3; } @Configuration public class Test2 { @Autowired private Test3 test3;

Spring-Boot-Admin application not starting because of error creating bean with name adminHandlerMapping

I am following this blog to try out a Spring-Boot-Admin application. And when I run the app it fails with the below error: Application run failed org.springfra

Convert Int in Request Body to Long always

I wrote my backend in Java, and the endpoint is hit with a request body. The endpoint has a JSON body that looks like this {"id": 1234, "data": {...}} Now, I

Content type multipart/mixed not supported / 415 UNSUPPORTED_MEDIA_TYPE (after Spring + Spring Boot upgrade)

I was previously using the following versions of Spring + Spring Boot: <springVersion>5.0.16.RELEASE</springVersion> <springBootVersion>2.0.5.

Load Spring Boot Classes in ClassLoader

I need to read a Spring Boot jar and load all the clases on a ClassLoader. My problem,in spring boot classes are on "/BOOT-INF/classes" directory and not on t

Spring using windows user instead of given username 'root' to hit the mysql

Getting the error "Access denied for user 'DEll'@'localhost' (using password: YES)" In the spring xml file I have given the user as 'root' not dell. I ha

Spring boot: JSP not found (404)

I'm trying to create a new project with spring boot. But I'm getting Error described below. I have added my code. Error HTTP ERROR 404 page not found He

Bean instantiation via factory method failed; exception org.springframework.beans.BeanInstantiationException

I have the following Spring configuration for Kafka: import org.apache.kafka.clients.producer.ProducerConfig; import org.springframework.boot.context.properties

Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.ConfigurationBeanFactoryMetadata

How to fix this error? Here is it: Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.ConfigurationBeanFactoryMetadata A

Get StateContext in @OnTransition annotated method

In the Spring Statemachine reference doc is this sample code: @WithStateMachine static class Bean1 { @OnTransition(source = "S1", target = "S2") publi

JUnit testing got initializationError with java.lang.Exception: No tests found matching

When running JUnit testing , it gave an initializationError: No tests found matching. Like this: prodapi-main-junit initializationError(org.junit.runner.manip

Spring Boot can't autowire @ConfigurationProperties

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

How to trigger commit programmaticaly on Spring Webflow 2 with Flow Managed Persistence Context

i have upgraded our application to SWF 2 and have implemented FMPC pattern. majority of our existing flow definitions doesn't have end-state, now using FMPC as

JOOQ - equivalent of hibernate interceptor for populating history fields?

Environment: Spring application, using JOOQ 3.7, generating the JOOQ mapping code automatically from the schema, using Postgres as my database. I've been porti

How to send jsonfile in api Request

I am facing an issue while sending the json file in request for RestController, Please check the details below I have a json file , let say test.json { "Pol