Questions tagged [spring5]
94 questions
1
vote
2 answers
Mapstruct decorator unable to inject the "delegate" bean in its generated code
I'm using the @DecoratedWith annotation of mapstruct 1.4.1Final along with spring-boot 2.7.0, but it is not working.
Describing my issue below here:
I have 2 pojos Person1 and Person2
public class Person1 {
String id;
String field1;
…

DockYard
- 989
- 2
- 12
- 29
1
vote
3 answers
SpringBoot @ConfigurationCondition is evaluated before the Spring Beans have been instantiated
I'm trying to use the @ConfigurationCondition annotation to register a bean based on a dynamic condition. This dynamic condition is present in another bean.
Putting the code below to better describe this :
Below the class ImplementationA.java which…

DockYard
- 989
- 2
- 12
- 29
1
vote
1 answer
Disable Liquibase execution at startup using Jetty + Spring (not Spring boot!)
I'm working in an application developed with Spring5 (not Spring boot!) that runs on Jetty. This application has module that uses the plugin liquibase-maven-plugin.
We generate a image from a dockerfile (base image jetty:9-jre8), where we add the…

rfc
- 21
- 3
1
vote
1 answer
Spring Framework upgrade 5.X leads to error class file for org.springframework.context.SmartLifecycle not found
I have been upgrading one of the app to spring framwork 5.X from 3.X, one of the problem I am failing to resolve it error is following - this makes a use of spring-jms
cannot access org.springframework.context.SmartLifecycle [ERROR]
class file for…

Milan Desai
- 1,228
- 8
- 23
1
vote
1 answer
how to merge the response of webClient call after calling 5 times and save the complete response in DB
i have scenario like:
i have to check the table if entry is available in DB then if available i need to call the same external api n times using webclient, collect all the response and save them in DB. if entry is not available in DB call the old…

user9990
- 93
- 1
- 1
- 6
1
vote
0 answers
Spring 5 Framework Logging with slf4j/log4j2
I have a application that I've put together to become familiar with Spring Framework 5, using Maven and Java 8. Once executed, it extracts some information from a PostgreSQL database table and logs it to the console (via slf4j/log4j2).
The actual…

Jazz
- 307
- 1
- 2
- 20
1
vote
0 answers
@value in spring 5 resolves to default value
@Value in spring 5 resolves to default value even though the property is being loaded from properties
@PropertySource({ "classpath:/config.properties"})
public class ConfigBean {
}
config.properties
com.demo.app.authEnabled=true
Test class
public…

Pakk
- 11
- 4
1
vote
1 answer
Log4jConfigurer in Spring 5
I had upgraded my project from Spring 4 to Spring 5 and I am resolving the deprecated/removed classes. As part of the effort I had noticed that log4jConfigurer is removed from Spring 5.
I have the following code:

Vamsi
- 619
- 3
- 9
- 22
1
vote
1 answer
Spring framework and Jersey integration
I have just started integrating spring framework 5.2.8 with jersey 3.0.2 version. I know we can do it with spring-boot but that's not my requirement. I want the service to run on tomcat server 8.5. I have customized the pom.xml for miniature size,…

Raghuveer
- 2,859
- 7
- 34
- 66
1
vote
1 answer
Spring oauth2 webclient ClientAuthorizationException: [server_error]
I am trying to utilize Spring 5 Webclient and the built in oauth2 security features.
@Bean("oauth2WebClient")
public WebClient oauth2WebClient(final ReactiveOAuth2AuthorizedClientManager reactiveOAuth2AuthorizedClientManager) {
final…

dev75
- 11
- 2
1
vote
1 answer
Prototype bean returns multiple instances within singleton object
I'm new to spring and doing some study about proxyMode=ScopedProxyMode.TARGET_CLASS. I wrote a simple project to test this with singleton and prototype bean. But it prints a new prototype bean instance when I print the object.
public class…

ever alian
- 1,028
- 3
- 15
- 45
1
vote
1 answer
Spring initializer class not found by Tomcat when using Java 16
I have a very simple Gradle (7.0-rc-1) script to initialise a single Spring 5 "hello world" endpoint using an embedded Tomcat instance. The original code is taken from a random example I found on the internet.
My example Gradle project can be found…

Shorn
- 19,077
- 15
- 90
- 168
1
vote
1 answer
"Could not obtain transaction-synchronized Session for current thread" error in Spring transaction management
I am working on migrating an application from Spring 3.2 to Spring 5. The application uses AWS RDS with a primary database as primary or master datasource and a replica database as read-only datasource. The application creates one session factory (…

mambo
- 9
- 1
- 2
1
vote
0 answers
RequestBody and Validation Annotation are null
I made a method in RestController. this method takes json objects, and enters it into the database and returns the status.
@PostMapping("/api/members")
public void newMember(
@RequestBody @Valid RegisterRequest regReq,
…

SE J
- 23
- 3
1
vote
0 answers
Spring Boot V 2.4.0 Using DaoAuthenticationProvider SHA-512
In spring 5 + the encryption type SHA-512 is deprecated. In my API project, I'm using the spring 5+, I have to use SHA-512 as the DB is old type password encryption. My encoder method needs to return a custom class object that encodes to SHA-512…

Adam Obaidi
- 189
- 3
- 13