Questions tagged [spring-autoconfiguration]
99 questions
2
votes
0 answers
Custom AutoConfiguration is not detected by spring application
Hi I created one custom auto configuration library as following:
@Configuration
@EnableConfigurationProperties(RefreshProperties.class)
public class PropertiesRefresherAutoConfiguration {
public static final String AUTO_REFRESH_ENABLED =…

scorpion
- 21
- 3
2
votes
0 answers
Is it a good practice to annotate beans inside a custom library with @Component or @Service in Spring Boot?
I am creating a Spring Boot library which can be used for my main projects. Is it not a good practice to annotate beans inside a custom library with @Component or @Service in Spring Boot? If so, why?
Because I saw an article saying,
Do not annotate…

Tech Guy
- 55
- 7
2
votes
2 answers
required a bean of type 'io.micrometer.core.instrument.MeterRegistry' that could not be found
Recently we upgraded spring-boot version to 2.7.2 and spring framework version to 5.3.22. Since then we are seeing this error in one of the apps
"required a bean of type 'io.micrometer.core.instrument.MeterRegistry' that could not be found."
Spring…

Anil Maddukuri
- 643
- 1
- 7
- 13
2
votes
1 answer
unable to autowire custom spring boot library project to my application
Importing custom spring-boot library jar to my application, and autowiring show the following error when I run the application
Parameter 0 of constructor in com.dilla.de.orca.addresssvc.service.TestScheduler required a bean of type…

user1986244
- 259
- 2
- 12
2
votes
1 answer
Spring Boot autoconfigure and its dependencies
I checked the source code of module spring-boot-autoconfigure
It has configurations classes for plenty of technologies : data, redis, cassandra, JPA, LDAP etc...
How can this module can compile properly without including all theses technologies…

AntonBoarf
- 1,239
- 15
- 31
2
votes
1 answer
spring boot auto configuration. unexpected behaviour
I am trying to use spring boot auto configuration feature and got an issue.
I created a github repo to be able to reproduce easily the "issue":
git clone https://github.com/clembo590/issues.git --branch spring_boot_auto_configuration
just run mvn…

clembo590
- 43
- 3
2
votes
1 answer
Does @SpringBootApplication scans test folder for configurations?
I've a @SpringBootApplication annotation in main class of my Spring Boot Application with ordinary folders structure (and @SpringBootApplication is one level package upper then beans in other packages)
I defined some @Configuration classes in some…

J.J. Beam
- 2,612
- 2
- 26
- 55
2
votes
1 answer
Spring Boot - autoconfigure if any property with prefix exists
I'm trying to register an autoconfiguration with @ConditionalOnProperty. This configuration should be created when there is any property with a predefined prefix.
For example, this configuration should be created when there is one of the properties…

geobreze
- 2,274
- 1
- 10
- 15
2
votes
0 answers
Spring boot @Configuration with @ConditionalOnClass not working
I have created a module with JMSConnectionConfig as given below.
@ConditionalOnClass(JmsTemplate.class)
@Configuration
@Log4j2
public class JMSConnectionConfig {
...............
...............
...............
}
I have two SpringBoot…

SmartTechie
- 135
- 2
- 10
2
votes
2 answers
How to refresh Bearer token Automatically for Okta
I have an application (not reactive) with Angular UI, Zuul and a few Services which are integrated with Okta login (OAuth). This works fine but is stuck after the jwt token expires. Some details about the workflow
The app URL is pointing to…

Tech
- 33
- 7
2
votes
0 answers
SpringBoot - Register Bean as Rest Controller
I'm using Spring Boot AutoConfiguration for registering the beans. Need to find a way through which I can register the beans configured via Auto-Configuration as a Rest Controller
SampleController.java
public class SampleController
{
…

Daanish Sarguru
- 83
- 1
- 8
2
votes
2 answers
Configuring thread pool profile in spring boot camel application
We are modernizing one of our applications and we decided to use Spring Boot together with Apache Camel.
One of the configuration files from old version has something like this:

CallanSM
- 303
- 2
- 10
- 20
2
votes
1 answer
SpringBoot disabling DataSourceAutoconfigure error while running Junit Tests
I have Springboot application works fine which connects to the Datasource. For Junit I have disabled the Autoconfigure of DataSource by excluding the DatasourceAutoConfiguration, DataSourceTransactionManagerConfiguration,…

jack
- 803
- 3
- 15
- 26
1
vote
1 answer
My SpringBoot autoconfiguration library isn't loaded automatically
I am creating an autoconfiguration library for SpringBoot 3.1.0. The source code can by found here https://github.com/ugwun/spring-boot-starter-openai
I am following this documentation for creating autoconfiguration libraries:…

ugwun
- 13
- 2
1
vote
1 answer
Why does @AutoConfiguration use proxyBeanMethods = false, @AutoConfigureBefore, @AutoConfigureAfter
Spring Boot auto configuration was recently changed with version 2.7 and most of the settings deprecated with version 3.0 (you can find details here). Also, they introduced new annotation for auto configuration classes which is @AutoConfiguration. I…

Hüseyin Aydın
- 486
- 5
- 9