Мой вопрос очень сложный. На самом деле, мой spring-boot
проект в порядке
в одну сторону: ./gradlew bootRun
это можно начать
по-другому: Run Application
не в порядке
Я думаю, spring-boot
установка конфигурации по умолчанию не эффективна, но я не знаю, как ее решить.
yml config и код
spring:
datasource:
url: jdbc:mysql://localhost/test
username: root
@Bean
public SqlSessionFactory sqlSessionFactory(DataSource dataSource) {
SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
factoryBean.setDataSource(dataSource);
Resource mybatisResource = new ClassPathResource("mybatis-config.xml", Application.class.getClassLoader());
factoryBean.setConfigLocation(mybatisResource);
SqlSessionFactory sessionFactory = null;
try {
sessionFactory = factoryBean.getObject();
} catch (Exception e) {
log.error("init sqlSessionFactory failed.", e);
}
return sessionFactory;
}
***************************
APPLICATION FAILED TO START
***************************
Description:
Cannot determine embedded database driver class for database type NONE
Action:
If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).`