java - Spring boot creating configuration files when it should not -


i have excluded db related autoconfiguration in spring boot application. still trying create jdbctemplateconfiguration , failing not not finding datasources.

@enableautoconfiguration(exclude = {datasourceautoconfiguration.class, jmsautoconfiguration.class, mongoautoconfiguration.class, mongodataautoconfiguration.class, datasourcetransactionmanagerautoconfiguration.class, hibernatejpaautoconfiguration.class}) 

stacktrace

error - org.springframework.beans.factory.beancreationexception: error creating bean name 'jdbctemplate' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/datasourceautoconfiguration$jdbctemplateconfiguration.class]: bean instantiation via factory method failed; nested exception org.springframework.beans.beaninstantiationexception: failed instantiate [org.springframework.jdbc.core.jdbctemplate]: factory method 'jdbctemplate' threw exception; nested exception java.lang.illegalargumentexception: property 'datasource' required 

spring boot docs describe 3 spring boot mechanisms how configure datasource bean:

  1. embedded database -> add embedded db engine classpath
  2. standard sql data source -> configure jdbc access in configuration file
  3. jndi db access -> configured via configuration file

additionally can configure datasource bean explicitly standard spring ioc mechanisms.

your error indicates non of these constructs defining datasource bean exist in application.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -