Questions tagged [spring-boot-2]
111 questions
0
votes
3 answers
Getting error when upgrading spring boot from 2.2.2 to 2.3.2.RELEASE
I am upgrading from spring boot 2.2.2 to 2.3.2.RELEASE and getting below error. I am sure that it is not related to the port which is already in use. Also, I have changed the logging from logging.file to logging.file.name as per spring boot…

Ravi
- 195
- 3
- 15
0
votes
1 answer
Mono.then() not executing when in tests
I'm trying to test the following code using integration tests:
return ((Mono

Francisco Aguiar
- 3
- 3
0
votes
1 answer
application.yml is not loading in spring boot 2 application with apache-cxf
I am new to spring boot2 with apache-cxf. I am trying to load the yml properties, but it is returning empty object.
When I am using spring.config.location=classpath:application.yml, then it is loading properly. If I don't give anything, then it is…

Dharisi Suresh
- 150
- 2
- 14
0
votes
1 answer
Is there a way to configure cross-origin scripting in Spring Boot from a properties file?
I'm using Spring Boot 2 and Java 11. When developing locally (frontend is a React app), I'm configuring allowing cross-origin requests by creating a configuration file and adding this to it
@Configuration
public class AppConfig implements…

satish
- 703
- 5
- 23
- 52
0
votes
1 answer
Springboot, Powermockito, failing to mock static method
First, I apologize for asking source code.
What is the simplest way to MOCK static method?
All the suggestions that is provided all over the internet is failing with initialization
package com.example.demo;
import java.net.InetAddress;
import…

Popeye
- 365
- 3
- 13
0
votes
1 answer
IllegalArgumentException during parsing ResponseBody
I'm working on Spring Boot 2.0.3
I'm trying to parse a simple JSON payload such as below
{
"title": "Test Title",
"description": "Test Desc"
}
Model with validations (kotlin)
data class SimpleObject(
@NotNull
@JsonProperty("title")
…

HMK
- 383
- 1
- 5
- 18
0
votes
1 answer
How I can use Sleuth Span in spring boot 2
Trying to upgrade from spring boot 1 to 2, The problem I'm facing is with tracing
In spring boot 1, we are using sleuth Trace that seems like deprecated in the spring boot 2 and suggesting to use 'brave'.
One of the problems is our another…

Srinath
- 3
- 1
- 4
0
votes
1 answer
In Spring Boot 2, is it possible to add a security rule that allows access only for a specific user?
I'm using Spring Boot 2 and Spring Security 11 with Java 11. I'm creating an API-only application and trying to secure endpoints relating to "users" ...
@Configuration
@EnableWebSecurity
class SecurityConfiguration extends…

satish
- 703
- 5
- 23
- 52
0
votes
0 answers
Resilience4j circuit breaker actuator heath check metrics showing some negative numbers
I am using resiliance4j circuit breaker with spring boot. in the actuator health point metrics, I am seeing some disparities in as slow-calls, a slow failed calls number are coming in negative instead of positive. which is not letting my circuit…

aprul
- 3
- 1
- 7
0
votes
1 answer
Deploying app onto AWS Lambda throws Postgres Driver error
I created a spring-boot2 app and also spun up a POSTGRES DB on AWS. I can connect to it fine when I launch the app locally. However, when I right click on template.yaml and choose Deploy Serverless application, the deployment goes fine. But in the…

user3754524
- 23
- 5
0
votes
1 answer
java test compiling error:'bad signature ¾4s9' when upgrade spring boot 1.0 to 2.0
I have a gradle project like this:
root
|
|---- projectA
| |
| |----main
|
|---- projectB
| |
| |----test
...
projectA is upgrading springboot 1.0 to 2.0
projectA gradle.build is like this:
...
jar {
enabled =…

dayu
- 1
- 2
0
votes
0 answers
Spring Boot2.0 - @SessonScope cannot be updated and is not reflected in HttpSession
In Spring Boot1.5, it was possible to update the instance with @SessionScope.
However, when Spring Boot 2.0 is used, the value is not updated and it remains null.
Session-scoped component:
@Data
@SessionScope
public class UserDto {
private String…

Tsukeawase 1013
- 1
- 1
0
votes
1 answer
Prometheus metrics not give path variable values
Code sample from spring boot application, which is producing prometheus metrics.
I am trying to access it with http://localhost:8080/myApi/ABC.
But In prometheus metrics it is producing the metrics with "uri=/myApi/{refNum}".
Promotheus…

user3756799
- 81
- 8
0
votes
1 answer
How to have 2 annotation toggled for different profile for the same Feign client Interface
How to have 2 annotation toggled for different profile for the same Feign client Interface?
I use a Feign Client Interface which has the following code when used with load balancer url. This I call as Non-Eureka for reference:
@FeignClient(name =…

abhihello123
- 1,668
- 1
- 22
- 38
0
votes
1 answer
MalformedStreamException when uploading file in Spring Boot 2.2.5 application
After upgrading Spring Boot from 2.2.4 to 2.2.5 in my application, I get the following exception when uploading files with a multipart/form-data form:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request…

Vlad
- 844
- 1
- 12
- 22