Skip to main content
Filter by
Sorted by
Tagged with
Best practices
2 votes
2 replies
127 views

I have a Spring Boot application that relies on the default DataSourceAutoConfiguration to create my DataSource bean. I also have a custom bean that must be fully initialized before the DataSource ...
Harry Yang's user avatar
2 votes
2 answers
148 views

I’m working on a Spring Boot application where I have multiple implementations of a service interface, and I want to automatically wire them into a Map keyed by an enum type. Specifically, I have a ...
yaroslav96's user avatar
-2 votes
1 answer
613 views

I wanted to upgrade my spring version from 5.3.39 to the 6 series. But when I tried to do that, it didn't compile and threw an error. This is the error that I'm getting: Failed to execute goal org....
Nishanth SR's user avatar
0 votes
0 answers
51 views

I'm trying to dynamically invoke a method using Spring's ArgumentConvertingMethodInvoker, where the method expects a POJO (e.g., UserDTO), but the arguments I'm passing in are Map<String, Object>...
kai kang's user avatar
0 votes
0 answers
51 views

We use Spring Boot 1.3.8 (old project - old version I know) and we have this @Configuration class within the application: import org.springframework.context.annotation.Bean; import org.springframework....
quma's user avatar
  • 5,817
0 votes
2 answers
157 views

I've this class: @Slf4j @Configuration public class TxnIdGeneratorProperties { @Bean public TimeBasedTxnIdGenerator seqGenerator() { if (log.isInfoEnabled()) log.info(&...
Arun Sudhakaran's user avatar
0 votes
1 answer
103 views

I created an Java Spring library to audit and log execution times during the execution of my application. I deployed it on SonaType and load it as a dependency in a demo project. The properties of my ...
Speedkillsx's user avatar
0 votes
2 answers
160 views

I want to 'override' a bean from type MicrometerObservationCapability https://github.com/spring-cloud/spring-cloud-openfeign/blob/main/spring-cloud-openfeign-core/src/main/java/org/springframework/...
ROZZ's user avatar
  • 1,422
0 votes
1 answer
42 views

I have this application that works fine for a single job: interface Job { void foo(); } class JobA implements Job { void foo() {...} } class JobB implements Job { void foo() {...}...
kawikawi's user avatar
0 votes
1 answer
292 views

Is there any way to use @ConditionalOnProperty twice for the same bean? I have two properties, that are mapped to "A" or "B" individually. Spring configuration: @Bean @...
kawikawi's user avatar
1 vote
0 answers
604 views

I can't post real code but this is a modified version of what I'm seeing, with fake class names. On startup of my Spring application, I see this log: *************************** APPLICATION FAILED TO ...
Shi Lilian's user avatar
0 votes
1 answer
246 views

I am setting up a soap service using Spring boot 3.4.3 and Apache cxf 4.1.1. I use the simpelest setup from Spring initializer only selecting web dependency and apache cxf like below: <dependencies&...
D.S. Safari's user avatar
0 votes
1 answer
70 views

I have a class that implements the Spring BeanDefinitionRegistryPostProcessor: package com.example.demo; import org.springframework.beans.BeansException; import org.springframework.beans.factory....
Rex's user avatar
  • 610
1 vote
0 answers
42 views

I am working on a Springboot + Camel app wherein I am dynamically building the IMAP connection over Java DSL as shown below. My problem is that although I am able to read all the IMAP parameters ...
raikumardipak's user avatar
2 votes
0 answers
2k views

Our Java / Spring boot application is using a library. The library has a class defined as below: @Configuration public class Test { public Test() { } @Autowired @Bean SomeBean ...
Vpal's user avatar
  • 79
1 vote
1 answer
85 views

Situation I am trying to create a autoconfiguration in which some properties must pass validation only in specific cases. I have a service MyService which requires credentials properties.username and ...
Aisteru Firë's user avatar
0 votes
1 answer
141 views

I have some mappers with the following code: import org.mapstruct.Mapper; import org.mapstruct.MappingConstants; @Mapper(componentModel = MappingConstants.ComponentModel.SPRING) public interface ...
Bahar's user avatar
  • 3
0 votes
1 answer
113 views

I am trying to learn Spring Security. I have understood a bit, but I am encountering a cycle error that I cannot seem to resolve. I will also share the code for the classes with you. Springboot ...
Recep Baykan's user avatar
0 votes
2 answers
244 views

In my spring boot application. I created a class name Book and annotated that class with @Component annotation. Then I created a AppConfig class with @Configration annotation and in that class created ...
Code007's user avatar
0 votes
1 answer
50 views

I have a DAO impl class that I'm trying to write a unit test for using testng. My class has a SessionFactory autowired into it which is why I'm using the MockBean annotation in my test class. In my ...
Stormy's user avatar
  • 1
0 votes
0 answers
76 views

My SpringBoot version is 2.3.4, database is Mysql 5.7.35 It's we all known that SpringBoot can use @ConditionalOnProperty to conditionally load beans. Can we move the parameters from the configuration ...
pursuit's user avatar
0 votes
2 answers
88 views

I am trying to connect to a database which will hold log in information for my application. I keep getting this error: APPLICATION FAILED TO START Description: Field userDetailsService in com.neet....
Neet's user avatar
  • 11
1 vote
1 answer
78 views

I have been learning Spring Boot for a week now yesterday I faced an error ` Field db in com.example.test.tutorial.TutorialApplication required a bean of type 'com.example.test.tutorial.DB' that could ...
Sudipa Sarkar's user avatar
1 vote
1 answer
465 views

I recently upgraded to Spring boot 3.0.12 from 2.7. But after doing the migration my integration tests are not running properly as they are missing spring beans. I started debug logging and it is not ...
Deepak Bhardwaj's user avatar
1 vote
1 answer
327 views

I'm writing a custom Spring Boot starter and need to check for certain requirements in the client application's context. I do this at @Conditional evaluation time using custom Condition classes. One ...
fabio trabattoni's user avatar
0 votes
1 answer
1k views

I want to ensure that the MyKafkaProducer bean is only activated when KafkaAutoConfiguration is loaded, so I have created the code as follows: @Service @ConditionalOnBean(KafkaAutoConfiguration.class) ...
Jiwon's user avatar
  • 1,246
0 votes
0 answers
317 views

I'm facing a classic issue in spring that states the following: org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'solRepository' for bean ...
anothercoder's user avatar
1 vote
0 answers
122 views

I am developing a service by combining Kotlin, Spring Boot, multi-module, and hexagonal architecture. While implementing the login logic, I encountered the following error: *************************** ...
ani's user avatar
  • 11
0 votes
0 answers
132 views

Why is the Spring Boot new version like this? The old version doesn't.Annotation-specified bean name 'application' for bean class [xxx.Application] This is a multi-module demo. Annotation-specified ...
Biel Chen's user avatar
1 vote
1 answer
1k views

in spring5 we can create a bean like below. <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name=&...
Bharath's user avatar
  • 147
0 votes
1 answer
305 views

I have a Spring Boot application halfway through migrating from old style Hibernate DAOs using a SessionFactory to Spring's JpaRepositories. The problem I am facing is that in unit tests, I have some ...
Daniel Pop's user avatar
-1 votes
1 answer
1k views

problem statement: conflict between two beans with same name example scenario Inteface public interface FakeInterface{ } implementations which will act as beans @Slf4j @Service public class ...
Rajoli Hemanth Kumar's user avatar
0 votes
0 answers
61 views

I want to send events and messages of different object types using Kafka topics. So I have producer configuration class in which I create the beans of the class KafkaTemplate and ProducerFactory: @...
camilajenny's user avatar
  • 5,310
0 votes
1 answer
52 views

I'm creating a desktop app using spring and javafx. The issue that I'm facing is with a repository that I have. I'm using the Service component to create an excel file, but I have some issues with the ...
ManosAnast's user avatar
0 votes
1 answer
550 views

I have the error: "Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Exception IO: Invalid connection string ...
Davide's user avatar
  • 1
0 votes
1 answer
288 views

I recently attempted to use the Jackson CsvMapper and I found a peculiar "feature" that I think is a bug in the jackson lib. If I create a Spring bean for the mapper it appears to ignore the ...
peekay's user avatar
  • 1,271
2 votes
1 answer
569 views

I've seen several "how to write a custom Condition" (org.springframework.context.annotation.Condition) https://docs.spring.io/spring-framework/docs/4.2.x/spring-framework-reference/html/...
granadaCoder's user avatar
  • 28.3k
0 votes
1 answer
982 views

After migrating Spring Boot version from 2.7.14 to 3.2.2 I get a warning when I start the service. WARN [info-service,,]" 50964 --- [main] trationDelegate$BeanPostProcessorChecker : Bean 'org....
Ali Aliyev's user avatar
1 vote
2 answers
1k views

Basically, I have a task, I want to create a Docker container when running a Spring Boot application using Docker Java API and then use that container in various controllers. When I create Bean with ...
macgood's user avatar
  • 51
0 votes
0 answers
136 views

I have migrated our project from Spring (5.2.x) to Spring 6 with Hibernate 5.6. I am using JDK17 and our application server is Tomee 9.1.1. Now when I access one of the RestAPI, the beans(autowired) ...
SwathiBujuru's user avatar
0 votes
1 answer
67 views

I am trying to develop a spring boot application with my sql as the database. i have used jdbc . when trying to add multiple sql statements in the create_table.sql file it gives me an error which ...
malith shehan's user avatar
0 votes
0 answers
82 views

As per my requirement, i want to update configuration properties before they are used in creating beans. for that, i am extending PropertySourcesPlaceholderConfigurer and overriding loadProperties ...
Nitika Bansal's user avatar
0 votes
1 answer
450 views

My application.yaml has the following entries: spring: profiles: active: test include: h2, test key: enabled: on I have the following three bean definitions and would like to load the ...
jd466's user avatar
  • 578
3 votes
1 answer
1k views

In a Spring Boot test, when I annotated with @SpringBootTest, I get warning: Parameter 'systemProperties' is deprecated: Use systemPropertyVariables instead. Why is that and how can I fix it? This ...
MaduKan's user avatar
  • 936
-1 votes
3 answers
146 views

It's my first time encountering this error that says `Description: Parameter 0 of constructor in com.team.zah.blog.service.Impl.PostServiceImpl required a bean of type 'com.team.zah.blog.repository....
devash's user avatar
  • 13
0 votes
0 answers
52 views

I created two versions of this code (started learning Java Spring this week): //version 1 (Complete) public class Mello { public void fun2() { System.out.println("inside mello&...
Agrudge Amicus's user avatar
0 votes
1 answer
927 views

When I upgraded in SpringBoot, I have a problem: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java....
polyphylla's user avatar
-7 votes
1 answer
94 views

Can I create an spring bean which is a Java exception? And then throw it multiple times ( lets say using different strings via setter)
J.J. Beam's user avatar
  • 3,263
0 votes
1 answer
61 views

I have Master step @Bean public Step employeeMasterProfilePhoneStep() throws UnexpectedInputException, ParseException { return stepBuilderFactory.get(Constant.MASTER_PHONE_STEP) ....
Giri's user avatar
  • 141
0 votes
0 answers
37 views

So I'm Trying to make a demo banking app using multithreading. I have 2 classes BankAccount and Customer. I have annotated them both with @Component Here is the exception im facing. Exception in ...
Shawaal Saif's user avatar

1
2 3 4 5
17