Skip to main content

Questions tagged [spring-boot]

Use the Spring Boot tag for questions related to spring boot framework and the features it brings to your Web application. This includes questions about configuration, embedding of the Web servers, setting up metrics, health checks, externalized configuration etc. It does not include questions about the Web server itself, Java code running in your application, or standard spring components. Tag these questions with its own tags to get the best response!

67,109 questions with no upvoted or accepted answers
22 votes
1 answer
19k views

Gradle archive contains more than 65535 entries

I am integrating hadoop2.5.0 for running mapreduce job and spring-boot-1.2.7 release and getting error while including this Archive contains more than 65535 entries. My gradle jar dependency jar { ...
Saurabh's user avatar
  • 7,713
15 votes
0 answers
772 views

Django channels with Spring Boot Websockets (StompSession) do not work

Hey there we want to use Django just to execute python code and use channels for the results. Implemented everything the websockets are not working as they should. If I try to send something from our ...
CptDayDreamer's user avatar
14 votes
2 answers
6k views

How to ignore EI_EXPOSE_REP2 in case of spring autowired components

In my Spring Boot application, I use com.github.spotbugs:spotbugs-maven-plugin plugin. The spotbugs check reports no issues on following class: @Service public class FooService { @Autowired ...
Ari Manninen's user avatar
14 votes
1 answer
2k views

Working example of Spring Cloud Gateway with Redis session management?

Can you please point out any written or video tutorial of working example of spring-cloud-starter-gateway? Using spring-session-data-redis, Spring Boot 2 and possibly related libraries e.g. spring ...
bkk's user avatar
  • 427
14 votes
1 answer
2k views

How to migrate code from Spring Security to Reactive Spring Security?

I'm trying to migrate classic Spring Boot Application to Reactive Spring Boot Application, but I have a problems with this task. How to migrate the code below package com.example; import org....
Paul Wolf's user avatar
  • 141
14 votes
2 answers
7k views

Spring Security Caused by: org.springframework.security.config.annotation.AlreadyBuiltException: This object has already been built

In my spring boot application, When I add @PreAuthorize("hasAuthority('ADMIN')") on service layer class which is injected into UserDetailService implementation Class, I get an error "This object has ...
Mukun's user avatar
  • 1,806
13 votes
2 answers
3k views

Hibernate 6.1.5.Final unable to determine table reference

Hello StackOverflow Community, Attempted: Upgrading Spring Boot from 2.7.5 to 3.0.0, which uses Hibernate ORM core version 6.1.5.Final Entity Plant.java @Data @Entity public class Plant { @Id ...
MrC0mm0n's user avatar
  • 305
13 votes
1 answer
2k views

How to set up a cache fallback in SpringBoot when unable to connect to Redis?

There is a SpringBoot (v2.2.7) application, where a Redis cache is configured fragment of pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>...
diziaq's user avatar
  • 7,540
13 votes
4 answers
5k views

Required request part 'file' is not present - Angular2 Post request

I am trying to get my file upload functionality done using Angular2 and SpringBoot. I can certify that my java code for the file uploading working fine since I have tested it successfully using ...
vigamage's user avatar
  • 2,075
12 votes
1 answer
374 views

Register SPI dynamically at runtime

I'm attempting to create a custom implementation of java.nio.FileSystem for an existing Application. The implementation itself seems to work correctly within its context. However, the parent ...
Euklios's user avatar
  • 587
12 votes
1 answer
8k views

Failed to bind properties under 'server.port' to java.lang.Integer

Some time ago I faced with such issue: Failed to bind properties under 'server.port' to java.lang.Integer: Property: server.port Value: $PORT Origin: "server.port" from property ...
Nabla's user avatar
  • 171
12 votes
1 answer
1k views

QueryDsl MongoDB - Accessing Deeply Nested Object for Query

I have issues trying to access nested object when using BooleanBuilder. I have read that the default is 2 levels, but for my use case, I need to access 3rd level nested objects. So I have added @...
user1955934's user avatar
  • 3,395
12 votes
1 answer
3k views

How to generate Swagger UI from javadocs?

I can generate swagger UI on my Spring boot application from @Api @ApiOperation, @ApiResponses annotations. These annotations makes code a bit dirty. I wonder, how I can generate swagger ...
Aisultan's user avatar
  • 342
12 votes
2 answers
930 views

Using redis and elasticsearch concurrently, but it errors with "availableProcessors is already set to [4], rejecting [4]"

ERROR:Factory method 'elasticsearchClient' threw exception; nested exception is java.lang.IllegalStateException: availableProcessors is already set to [4], rejecting [4] I just want to use redis and ...
Mr.True's user avatar
  • 329
11 votes
0 answers
2k views

Server Sent Event (SseEmitter) - Broken pipe when timeout

The SSE using SseEmitter of SpringBoot 2.6.3 is working well, but when there is a timeout, the following error appears : org.apache.juli.logging.DirectJDKLog - : Changing async state from [STARTED] ...
Dupont's user avatar
  • 373
11 votes
0 answers
7k views

What is the cleaner and efficient way of implementing health check for Kafka in my spring boot application?

I have a spring boot (2.1.6) application that both consumes and produces messages to a (organization wide) common kafka instance. I am trying to implement health checks for this kafka broker in my ...
ishan's user avatar
  • 1,232
11 votes
0 answers
2k views

EC2 Instance - Sending STDOUT logs to Cloud Watch

Reading the 12factor app in the logging chapter, it suggests that the application logs should be sent to STDOUT. I found plenty of documentation on how to get the logs from STDOUT and send it to ...
Thiago's user avatar
  • 960
11 votes
0 answers
1k views

Getting "com.mongodb.MongoInternalException: The responseTo in the response does not match the requestId in the request" while connecting to mongodb

My app is using Spring-Boot framework. Everything was working fine until GC overhead error occurred. GC error was recovered but mongodb connection was giving this error continuously after it. But at ...
Harshit's user avatar
  • 1,372
11 votes
1 answer
5k views

How to shutdown application context between tests

I have 3 groups of tests: unit, integration, acceptance. Latter two groups launches ApplicationContext: minimal for "integration" and full for "acceptance". Both application contexts register queue ...
Sergey Galkin's user avatar
11 votes
3 answers
16k views

How to get the version of Spring Boot in the /info actuator endpoint

It's possible to include the version of Spring Boot in the banner.txt by adding ${spring-boot.version}. How can I do the same for the /info actuator endpoint? I've tried adding both of the following ...
jonathan.stiles's user avatar
11 votes
3 answers
2k views

Alternative for org.apache.commons.mail.util.MimeMessageParser compatible with Jakarta on Java 17

As I updated my Spring Boot application to Java 17 and Spring Boot 3, I migrated from Java EE to Jakarta. I used the MimeMessageParser of org.apache.commons.mail.util.MimeMessageParser, but it expects ...
pinacolada's user avatar
11 votes
1 answer
6k views

Can I use @MockBean to mock a bean in just one method of my test class?

I have this mvc test class @RunWith(SpringRunner.class) @SpringBootTest public class UserTest { private MockMvc mockMvc; @Resource private WebApplicationContext webApplicationContext; ...
Datz's user avatar
  • 3,599
10 votes
1 answer
12k views

Spring boot 3 upgrade: java.lang.NoClassDefFoundError: org/springframework/util/SocketUtils

Looks like SocketUtils is deprecated now as a part of spring boot 3 upgrade. While running controller tests, I am getting below error. Anyone have come across it and how was it solved? main] o.s.test....
sof_user's user avatar
  • 215
10 votes
1 answer
7k views

Spring Boot testing: Cannot bind @ConfigurationProperties - Ensure that @ConstructorBinding has not been applied

In a Spring Boot unit test, how can you mock @ConstructorBinding @ConfigurationProperties data class? Setup Both Kotlin 1.4.30 (for unit tests and config classes) Java 15 (with --enable-preview) (...
aSemy's user avatar
  • 6,823
10 votes
0 answers
3k views

Spring boot context load test hangs

We have a Spring Boot app written in Kotlin. The problem is it hangs during Maven clean test while running context load test below. Java: 14.0.1 Kotlin: 1.4.20 Spring boot:2.3.6.RELEASE Spring cloud:...
Vahid's user avatar
  • 1,827
10 votes
1 answer
2k views

Spring context indexer not working for dependency jar

I have some library jar lib.jar (made using spring boot but packaged as normal jar without spring boot plugin) which is made of spring boot and contains spring.components file generated by spring-...
Mahesh Bhuva's user avatar
10 votes
2 answers
3k views

SpringBoot hibernate gradle byte code enhancement

I am trying to mane hibernate OneToOne relationships work lazily. My setup is spring-data-jpa using hibernate and Gradle. Even this is a well-documented problem/feature and there is a lot of good ...
maxsap's user avatar
  • 2,981
10 votes
1 answer
3k views

Kafka Connect with Spring Framework

Is anyone aware of any Spring Boot integration with Kafka Connect? There is a spring-kafka project that I think gives a nice integration with Kafka clients but not connect and streams APIs.
dmaity's user avatar
  • 101
10 votes
0 answers
3k views

Spring Boot, Tomcat & Gradle: xalan & serializer jars not found

Yesterday I tried to merge some single spring boot projects into one new project and since then I am getting the following errors in my ide console when starting the project: Ignoring Class-Path ...
StephanM's user avatar
  • 1,380
10 votes
0 answers
1k views

Configuring custom Json Serializer for Spring controller test

I'm testing a controller: @RestController() public class MessagesController { ... } Using @WebMvcTest annotation: @RunWith(SpringRunner.class) @WebMvcTest(value = {MessagesController.class}) public ...
ElArbi's user avatar
  • 1,185

15 30 50 per page
1
2 3 4 5
2237