Reputation: 45
Description: I am using MongoDB and it keeps asking for a datasource. I have excluded the following:
exclude=DataSourceAutoConfiguration.class,
DataSourceTransactionManagerAutoConfiguration.class,
HibernateJpaAutoConfiguration.class,
JpaRepositoriesAutoConfiguration.class})
error:
Error starting ApplicationContext. To display the conditions report re-run
your application with 'debug' enabled.
2018-10-29 11:03:25.968 ERROR 4676 --- [ restartedMain]
o.s.b.d.LoggingFailureAnalysisReporter :
Description:
***************************
APPLICATION FAILED TO START
***************************
Parameter 1 of method batchConfigurer in org.springframework.boot.autoconfigure.batch.BatchConfigurerConfiguration$JdbcBatchConfiguration required a bean of type 'javax.sql.DataSource' that could not be found.
- Bean method 'dataSource' not loaded because @ConditionalOnProperty (spring.datasource.jndi-name) did not find property 'jndi-name'
- Bean method 'dataSource' not loaded because @ConditionalOnClass did not find required class 'javax.transaction.TransactionManager'
Action:
Consider revisiting the entries above or defining a bean of type 'javax.sql.DataSource' in your configuration.
Upvotes: 0
Views: 453
Reputation: 31600
Spring Boot is intended for building production grade applications. When it is used to build a Spring Batch application, it requires a data source to persist Spring Batch meta-data (See BATCH-2704).
But you can always use either:
BatchConfigurer
and use the MapJobRepository
(See here)Hope this helps.
Upvotes: 1