Проблема: Автоматическое подключение компонентов SingerDaoImpl и JpaRepositoryImpl приводит к нулевому результату. Исключение не генерируется, но данные не возвращаются. Использование представления Thymeleaf для отображения данных
Используемые технологии: Spring, JpaRepository, Hibernate, Thymeleaf, H2 Embedded DB (скрипт находится в папке resources / SQL), Spring MVC, javax.validation.
Я использую localhost: 8080 / singers для перечисления певцов через тимелеаф, расположенный в resources / templates / listSingers. html. После вызова контроллера / singers количество извлеченных певцов регистрируется в консоли через регистратор
То, что я вычеркнул: - Нет @Component (или его специализаций) Класс объявляется с новым оператором - Все bean-компоненты с @Autowired аннотируются @Component, @Repository или @Service - Сеттеры уже настроены, - @Qualifier уже указывает на правильный bean-компонент - Встроенная база данных IS заполняется данными, расположенными в resources / SQL / test. sql, и добавляется через класс DBConfig. java с помощью метода EmbeddedDatabaseBuilder.addScript ("SQL / test. sql") - Все зависимости в версии файла gradle.build управляются gradle как последняя версия
Ссылка на страницу github: https://github.com/NikitaDyagilev/LearningSprinbMVC
примечание: я использую Amazon Corretto Java 11
DBConfig. java
package com.example.demo.Config;
@Configuration
@ComponentScan
@EnableJpaRepositories(basePackages = {"com.example.demo.JpaRepo"})
@PropertySource("classpath:application.properties")
public class DBconfig {
@Value("${jdbc.driverClassName}")
private String driverClassName;
@Value("${jdbc.username}")
private String username;
@Value("${jdbc.password}")
private String password;
@Value("${jdbc.url}")
private String url;
private Logger logger = LoggerFactory.getLogger(DBconfig.class);
// MySQL DataSource Connection
@Bean
public DataSource dataSourceR(){
try{
SimpleDriverDataSource db =
new SimpleDriverDataSource();
Class<? extends Driver> driver =
(Class<? extends Driver>) Class.forName(driverClassName);
db.setDriverClass(driver);
db.setUsername(username);
db.setPassword(password);
db.setUrl(url);
return db;
} catch (Exception e){
logger.error("Something Went wrong when trying to Create the MySQL DataSource bean");
return null;
}
}
// Embedded DataSource Connection
@Bean
public DataSource dataSourceE(){
try{
EmbeddedDatabaseBuilder db =
new EmbeddedDatabaseBuilder();
db.setType(EmbeddedDatabaseType.H2);
db.addScript("SQL/table.sql");
db.addScript("SQL/test.sql");
return db.build();
} catch (Exception e ){
logger.error("There was an error when trying to create Embeded DataSource: ", e);
return null;
}
}
@Bean
public Properties hibernaProperties(){
Properties prop = new Properties();
prop.put("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
// prop.put("hibernate.dialect", "org.hibernate.dialect.MySQL8Dialect");
prop.put("hibernate.hbm2ddl.auto", "create-drop");
prop.put("hibernate.format_sql", true);
prop.put("hibernate.show_sql", true);
prop.put("hibernate.max_fetch_depth", 3);
prop.put("hibernate.jdbc.batch_size", 10);
prop.put("hibernate.jdbc.fetch_size", 50);
return prop;
}
@Bean
public PlatformTransactionManager transactionManager(){
return new JpaTransactionManager(entityManagerFactory());
}
@Bean
public JpaVendorAdapter jpaVendorAdapter(){
return new HibernateJpaVendorAdapter();
}
@Bean(name ="entityManagerFactory")
public EntityManagerFactory entityManagerFactory(){
LocalContainerEntityManagerFactoryBean emfb =
new LocalContainerEntityManagerFactoryBean();
emfb.setDataSource(dataSourceE());
emfb.setPackagesToScan("com.example.demo.Model");
emfb.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
emfb.setJpaProperties(hibernaProperties());
emfb.setJpaVendorAdapter(jpaVendorAdapter());
emfb.afterPropertiesSet();
return emfb.getObject();
}
}
Класс контроллера
package com.example.demo.Controllers;
import java.util.List;
@Controller
public class TestController {
private Logger logger = LoggerFactory.getLogger(TestController.class);
private SingerDao dao;
@GetMapping(value = "/hello")
@ResponseBody
public String sayHello(){
return "Hello There";
}
@GetMapping(value ="/homepage")
public String homepageListing(){
return "homepage";
}
@GetMapping(value="/singers")
public String listSingers(Model model){
logger.info("Listing Singers:");
List<Singer> singers = dao.findAll();
String[] names = new String[singers.size()];
for(int i = 0; i < names.length; i++){
names[i] = singers.get(i).getFirstName();
}
model.addAttribute("singersNames", names);
return "ListSingers";
}
@GetMapping(value="/getSinger{id}")
public String getSingerById(Model model,@PathVariable Long id){
model.addAttribute("singer", dao.findById(id).getFirstName());
return "getSinger";
}
@Autowired
public void setDao(SingerDao dao) {
this.dao = dao;
}
}
JpaRepository
package com.example.demo.JpaRepo;
@Repository("jpaRepositoryImpl")
public class JpaRepositoryImpl implements JpaRepository {
private EntityManagerFactory emf;
@Override
public List<Singer> findAll() {
return emf.createEntityManager()
.createQuery("select s from singer s")
.getResultList();
}
@Override
public Optional<Singer> findById(Long aLong) {
return (Optional<Singer>) emf.createEntityManager().createQuery("select s from singer s where s.id = ?id").
setParameter("id",aLong).getSingleResult();
}
@Autowired
@Qualifier(value = "entityManagerFactory")
public void setEmf(EntityManagerFactory emf) {
this.emf = emf;
}
}
Служба DAO
package com.example.demo.DAO;
@Service("singerDaoImpl")
public class SingerDaoImpl implements SingerDao {
private JpaRepository jpaRepo;
@Override
public List<Singer> findAll() {
List<Singer> singers = new ArrayList<>();
jpaRepo.findAll().forEach(item -> singers.add(item));
System.out.println("# Of Singers: "+singers.size());
return singers;
}
@Override
public Singer findById(Long id) {
return null;
}
@Autowired
@Qualifier(value="jpaRepositoryImpl")
public void setJpaRepo(JpaRepository jpaRepo) {
this.jpaRepo = jpaRepo;
}
}
Модель
package com.example.demo.Model;
@Table(name="singer")
@Entity(name="singer")
public class Singer implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="id")
private Long id;
@NotEmpty(message = "{validation.firstname.NotEmpty.message}")
@Size(min=3,max=60,message="{validation.firstname.Size.message}")
@Column(name="first_name")
private String firstName;
@NotEmpty(message = "{validation.lastname.NotEmpty.message}")
@Size(min=3,max=60,message ="{validation.lastname.Size.message")
@Column(name="last_name")
private String lastName;
@Temporal(TemporalType.DATE)
@Column(name="birth_date")
private Date birthDate;
@Column(name="description")
private String description;
@Basic(fetch=FetchType.LAZY)
@Lob
@Column(name="photo")
private byte photo;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public Date getDate() {
return birthDate;
}
public void setDate(Date date) {
this.birthDate = date;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public byte getPhoto() {
return photo;
}
public void setPhoto(byte photo) {
this.photo = photo;
}
@Transient
public String getBirthDateString(){
String birthDateString = "";
if(birthDate != null){
SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd");
birthDateString = sdf.format(birthDate);
}
return birthDateString;
}
@Override
public String toString() {
return "Singer{" +
"id=" + id +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", birthDate=" + birthDate +
", description='" + description + '\'' +
", photo=" + photo +
'}';
}
}
Редактировать: Я добавил logging.level.org.springframework = debug Вот соответствующая часть консоли
2020-05-26 11:26:13.500 INFO 14664 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2935 ms
2020-05-26 11:26:13.508 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'requestContextFilter'
2020-05-26 11:26:13.513 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'formContentFilter'
2020-05-26 11:26:13.513 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration'
2020-05-26 11:26:13.519 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'characterEncodingFilter'
2020-05-26 11:26:13.531 DEBUG 14664 --- [ main] o.s.b.w.s.ServletContextInitializerBeans : Mapping filters: characterEncodingFilter urls=[/*] order=-2147483648, formContentFilter urls=[/*] order=-9900, requestContextFilter urls=[/*] order=-105
2020-05-26 11:26:13.532 DEBUG 14664 --- [ main] o.s.b.w.s.ServletContextInitializerBeans : Mapping servlets: dispatcherServlet urls=[/]
2020-05-26 11:26:13.565 DEBUG 14664 --- [ main] o.s.b.w.s.f.OrderedRequestContextFilter : Filter 'requestContextFilter' configured for use
2020-05-26 11:26:13.565 DEBUG 14664 --- [ main] s.b.w.s.f.OrderedCharacterEncodingFilter : Filter 'characterEncodingFilter' configured for use
2020-05-26 11:26:13.566 DEBUG 14664 --- [ main] o.s.b.w.s.f.OrderedFormContentFilter : Filter 'formContentFilter' configured for use
2020-05-26 11:26:13.585 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'demoApplication'
2020-05-26 11:26:13.586 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'DBconfig'
2020-05-26 11:26:13.591 DEBUG 14664 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'jdbc.driverClassName' in PropertySource 'applicationConfig: [classpath:/application.properties]' with value of type String
2020-05-26 11:26:13.591 DEBUG 14664 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'jdbc.driverClassName' in PropertySource 'environmentProperties' with value of type String
2020-05-26 11:26:13.593 DEBUG 14664 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'jdbc.username' in PropertySource 'configurationProperties' with value of type String
2020-05-26 11:26:13.593 DEBUG 14664 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'jdbc.username' in PropertySource 'environmentProperties' with value of type String
2020-05-26 11:26:13.595 DEBUG 14664 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'jdbc.password' in PropertySource 'configurationProperties' with value of type String
2020-05-26 11:26:13.595 DEBUG 14664 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'jdbc.password' in PropertySource 'environmentProperties' with value of type String
2020-05-26 11:26:13.595 DEBUG 14664 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'jdbc.url' in PropertySource 'configurationProperties' with value of type String
2020-05-26 11:26:13.595 DEBUG 14664 --- [ main] o.s.c.e.PropertySourcesPropertyResolver : Found key 'jdbc.url' in PropertySource 'environmentProperties' with value of type String
2020-05-26 11:26:13.599 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'testController'
2020-05-26 11:26:13.607 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'singerDaoImpl'
2020-05-26 11:26:13.614 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'jpaRepositoryImpl'
2020-05-26 11:26:13.621 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'entityManagerFactory'
2020-05-26 11:26:13.673 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'dataSourceE'
2020-05-26 11:26:13.702 INFO 14664 --- [ main] o.s.j.d.e.EmbeddedDatabaseFactory : Starting embedded database: url='jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa'
2020-05-26 11:26:13.712 DEBUG 14664 --- [ main] o.s.jdbc.datasource.DataSourceUtils : Fetching JDBC Connection from DataSource
2020-05-26 11:26:13.713 DEBUG 14664 --- [ main] o.s.j.datasource.SimpleDriverDataSource : Creating new JDBC Driver Connection to [jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false]
2020-05-26 11:26:13.971 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : Executing SQL script from class path resource [SQL/table.sql]
2020-05-26 11:26:14.002 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 0 returned as update count for SQL: CREATE TABLE SINGER ( ID INT NOT NULL AUTO_INCREMENT, FIRST_NAME VARCHAR(60), LAST_NAME VARCHAR(40), BIRTH_DATE DATE, DESCRIPTION VARCHAR(2000) NULL, PHOTO BLOB NULL, VERSION INT NOT NULL DEFAULT 0, UNIQUE UQ_SINGER_1 (FIRST_NAME, LAST_NAME), PRIMARY KEY (ID) )
2020-05-26 11:26:14.002 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : Executed SQL script from class path resource [SQL/table.sql] in 30 ms.
2020-05-26 11:26:14.002 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : Executing SQL script from class path resource [SQL/test.sql]
2020-05-26 11:26:14.014 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('John', 'Mayer', '1977-10-16')
2020-05-26 11:26:14.014 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('Eric', 'Clampton', '1954-03-20')
2020-05-26 11:26:14.017 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('John', 'Butler', '1975-04-01')
2020-05-26 11:26:14.017 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('B.B' , 'King', '1925-09-16')
2020-05-26 11:26:14.019 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('Jimi', 'Hendrix', '1942-11-27')
2020-05-26 11:26:14.021 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('Eddie', 'Van Halen','1955-01-26')
2020-05-26 11:26:14.022 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('Saul Slash', 'Hudson', '1965-07-23')
2020-05-26 11:26:14.023 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('Stevie', 'Ray Vaughan','1954-10-03')
2020-05-26 11:26:14.023 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('David', 'Gilmour','1946-03-06')
2020-05-26 11:26:14.026 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('Kirk','Hammett','1992-11-18')
2020-05-26 11:26:14.027 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('Angus','Young','1955-03-31')
2020-05-26 11:26:14.028 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('Dimebad','Darrell','1966-08-20')
2020-05-26 11:26:14.029 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : 1 returned as update count for SQL: INSERT INTO SINGER (FIRST_NAME, LAST_NAME, BIRTH_DATE) VALUES ('Carlos','Santana','1947-07-20')
2020-05-26 11:26:14.030 DEBUG 14664 --- [ main] o.s.jdbc.datasource.init.ScriptUtils : Executed SQL script from class path resource [SQL/test.sql] in 28 ms.
2020-05-26 11:26:14.039 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker'
2020-05-26 11:26:14.043 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties'
2020-05-26 11:26:14.064 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Autowiring by type from bean name 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker' via constructor to bean named 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties'
2020-05-26 11:26:14.065 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Autowiring by type from bean name 'org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker' via constructor to bean named 'org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@456d6c1e'
2020-05-26 11:26:14.227 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'hibernaProperties'
2020-05-26 11:26:14.230 DEBUG 14664 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating shared instance of singleton bean 'jpaVendorAdapter'
2020-05-26 11:26:14.245 DEBUG 14664 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2020-05-26 11:26:14.294 INFO 14664 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2020-05-26 11:26:14.412 INFO 14664 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.15.Final
2020-05-26 11:26:14.685 INFO 14664 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-05-26 11:26:14.906 DEBUG 14664 --- [ main] o.s.j.datasource.SimpleDriverDataSource : Creating new JDBC Driver Connection to [jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false]
2020-05-26 11:26:14.940 INFO 14664 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
Hibernate:
SQL Запрос *
drop table if exists singer CASCADE
2020-05-26 11:26:16.139 DEBUG 14664 --- [ main] o.s.j.datasource.SimpleDriverDataSource : Creating new JDBC Driver Connection to [jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false]
Hibernate:
create table singer (
id bigint generated by default as identity,
birth_date date,
description varchar(255),
first_name varchar(255),
last_name varchar(255),
photo blob,
primary key (id)
)
Я нашел выражение
javax.validation.NoProviderFoundException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:291) ~[validation-api-2.0.1.Final.jar:na]
at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:257) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean.afterPropertiesSet(OptionalValidatorFactoryBean.java:40) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.boot.autoconfigure.validation.ValidatorAdapter.afterPropertiesSet(ValidatorAdapter.java:83) ~[spring-boot-autoconfigure-2.3.0.RELEASE.jar:2.3.0.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1792) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1306) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1226) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:885) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:789) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:539) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:895) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
at com.example.demo.DemoApplication.main(DemoApplication.java:13) ~[main/:na]