Java Spring引导依赖项错误gradle

Java Spring引导依赖项错误gradle,java,gradle,spring-boot,dependencies,Java,Gradle,Spring Boot,Dependencies,我有一个新的spring boot项目,并且包含了一些依赖项。问题是,在第一次运行时,“rest”和“jpa”依赖关系运行得很好,但在第二次运行时,我得到了一个巨大的错误 dependencies { compile('org.springframework.boot:spring-boot-starter-cache') compile("org.springframework.boot:spring-boot-starter-data-rest") compile('org.springfr

我有一个新的spring boot项目,并且包含了一些依赖项。问题是,在第一次运行时,“rest”和“jpa”依赖关系运行得很好,但在第二次运行时,我得到了一个巨大的错误

dependencies {
compile('org.springframework.boot:spring-boot-starter-cache')
compile("org.springframework.boot:spring-boot-starter-data-rest")
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-hateoas')
compile('org.springframework.boot:spring-boot-starter-mail')
compile('org.springframework.boot:spring-boot-starter-remote-shell')
compile('org.springframework.boot:spring-boot-starter-social-facebook')
compile('org.springframework.boot:spring-boot-starter-social-twitter')
compile('org.springframework.boot:spring-boot-starter-web')
runtime('mysql:mysql-connector-java')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
错误消息如下所示(太大,无法粘贴到此处):


我正在使用Intelij IDEA 2016.1.1

此堆栈跟踪中的重要错误消息似乎是:

Cannot determine embedded database driver class for database type NONE. 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)
它说您没有定义要使用什么数据库(它位于什么类型的数据库)。 我想您需要向
应用程序.properties
文件添加一些属性,例如:

spring.datasource.url = (URL to your data source)
spring.datasource.driverClassName = (fully qualified class name of your datasource driver)
您可以使用H2内存中数据库:

spring.datasource.url=jdbc:h2:mem:databaseName;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.driverClassName=org.h2.Driver

请注意,您还需要将数据库的依赖项包含到Gradle依赖项中(
compile(
用于h2)。

对于类似的java错误,您会发现有许多以
开头的行是由以下原因引起的:
,,这是因为在代码中有许多地方,代码捕捉到异常,然后再次抛出异常。
要找到真正的问题,您需要查看由
-条目引起的最后一个

我不能说你提供的信息本身有什么问题。但至少有stackoverflow处理此消息

Cannot determine embedded database driver class for database type NONE. 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).