【发布时间】:2018-03-11 01:14:25
【问题描述】:
我正在尝试使用 Spring Boot CLI (1.5.7) 实现一个使用 h2 数据库的小型 REST 服务。 但是解决依赖关系不起作用。我收到错误: “引起:org.springframework.beans.factory.UnsatisfiedDependencyException” ... "工厂方法 'dataSource' 抛出异常;嵌套异常是 org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: 无法确定数据库类型 NONE 的嵌入式数据库驱动程序类"
@Grab("h2")
import java.sql.ResultSet
class ContactRepository {
@Autowired
JdbcTemplate jdbc
List<Contact> findAll() { ... }
}
我认为通过使用 @Grab("h2") Spring Boot 会将类/jar 添加到类路径中。我找不到很多关于 Spring Boot CLI(不是云版本)的资源。 我将非常感谢您的帮助。
【问题讨论】:
标签: spring spring-boot command-line-interface h2