Questions tagged [spring-autoconfiguration]
99 questions
1
vote
2 answers
Spring Customize whitelabel error - redirect
I am trying to customize /error by implementing Error controller in a class annonated with RestController.
The Spring Boot app includes autoconfiguration Library and does not explicitly set or use MVC.
@RequestMapping("/error")
public String…

Angellic Doll
- 43
- 9
1
vote
1 answer
Start liquibase after activiti under Spring Boot 2
We have a Project with activiti and liquibase dependecies.
Activiti is automatically configured (exc. 'spring.activiti.async-executor-activate' and 'spring.activiti.database-schema-update' params in application.yml) and liquibase too (exc.…

antropoff
- 111
- 2
- 3
- 14
1
vote
1 answer
How to run DDL after Spring auto create db?
My question is simple. How to run any DDL statements after Spring's automatic schema creation?
I have set the following in my application-test.properties to auto create the database schema from the entity Java…

SamwellTarly
- 802
- 8
- 15
0
votes
0 answers
Spring @ConfigurationProperties constructor binding not working for modules
I can't seem to get constructor binding to work for a properties file created with @ConfigurationProperties in my own auto-configuration module. The issue takes place using Spring Boot v3.1.2 with spring boot starter parent and Kotlin.
This code…

Bent Holden
- 11
- 3
0
votes
1 answer
Reasons for delegating bean registration
I had a question while writing to test auto-configuration.
@Configuration
public class SimpleConfiguration {
@Bean
public BigDecimal aDecimal( String example ) {
return new BigDecimal( example );
}
}
@Configuration
public class…

raboy
- 1
- 1
0
votes
1 answer
When updating to springboot3.1.1, I can not import ...ElasticSearchRestHealthContributorAutoConfiguration;
When updating to springbootfrom 2 to 3.1.1, I can not import…

Lareina
- 1
- 1
- 1
0
votes
1 answer
Unable to exclude DataSourceAutoConfiguration class while running fat jar from cmd
Below is my spring boot main class configuration :
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@Configuration
@EnableAutoConfigurationProperties
public class MainClass{
}
When i am running this spring boot using intellij,…

Ink Oveflow
- 3
- 2
0
votes
1 answer
SpringBoot Kafka autoconfig - keystore location prefixed with exploded war directory name
In my property file I have
spring.kafka.ssl.key-store-location=${javax.net.ssl.keyStore:}
Operations confirmed that -Djavax.net.ssl.keyStore=/opt/app/config/keystore.jks is being called to start Tomcat.
Just to verify I…

Cory Wandling
- 85
- 6
0
votes
2 answers
How to use the SSL autoconfiguration with a base64 encoded PKCS12?
I have a Spring Boot 3.1 application with the following configuration:
spring:
ssl:
bundle:
pem:
my-client:
keystore:
certificate: "MIIKyAIBAzCCC..."
private-key: "keystore-password"
…

rwinner
- 348
- 3
- 6
- 15
0
votes
0 answers
Why @ConditionalOnBean does not match despite fullfilled criteria?
This is first time I try to create a library for SpringBoot application with autoconfiguration.
I have my configuration entrypoint configured like (some parts are…

Antoniossss
- 31,590
- 6
- 57
- 99
0
votes
0 answers
AttributeConverter not auto applied when auto configured
In a Spring Boot starter project I've created an AttributeConverter, and applied it with autoApply=true @Converter annotation. My problem is that the projects using the starter still need to specify @Convert for the fields.
I've created the…

Brian Siim Andersen
- 11
- 2
0
votes
0 answers
Order of bean creation and call to auto-configuration class in Spring Boot
I am creating a spring boot library with auto-configuration. The library reads the message from given kafka topic and processes it.
The library has a configuration class:
public class LibConfiguration{
public String topicName;
}
The application…

Kumar
- 1,536
- 2
- 23
- 33
0
votes
1 answer
Manually register a Spring @Configuration class
I have a Spring @Configuration class which creates a bunch of Spring Beans and has few Spring Data Annotations. Is there a way for me to not add the @Configuration Annotation so that Spring does not pick it automatically and instead I can add it…

Jobin Thomas
- 75
- 1
- 8
0
votes
2 answers
@AutoConfiguration runs before user-defined beans
I have an autoconfigure module in some starter, with this configuration:
@Configuration
public class AutoConfiguration {
@Bean
@ConditionalOnMissingBean
public SomeBeanInterface someBean() {
return new DefaultBean();
}
}
An…

Cesar
- 73
- 8
0
votes
1 answer
Spring boot auto configuration with @ConditionOnBean(DataSource.class) not working as expected
I'm trying to make a very simple autoconfiguration for a usage of Togglz state repository for a database. I want to have a JDBCStateRepository when there a DataSource bean available and keep the default one when running test excluding database or…

Emilien
- 106
- 9