小编mri*_*974的帖子

SpringBoot DataSource配置

我正在尝试使用该application.properties文件来配置Spring Boot必须使用的数据源.

我把以下属性放在里面:

spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.user=test
spring.datasource.password=test
spring.datasource.jdbcUrl=jdbc:postgresql://localhost:5432/test
Run Code Online (Sandbox Code Playgroud)

application.properties文件很好地被其他系统使用.但我不能让它为自动数据源配置工作.

我仍然得到这个例外:

org.springframework.beans.factory.BeanCreationException: Cannot determine embedded database url for database type NONE.
Run Code Online (Sandbox Code Playgroud)

包含并加载postgresql驱动程序.我可以使用Configuration类和上面相同的参数配置数据源.

我还添加了@EnableAutoConfiguration@EnableJpaRepositoriesApplication.class.

有线索吗?

spring jpa spring-boot

5
推荐指数
1
解决办法
4553
查看次数

Spring Boot - 部署到Tomcat时放置属性文件的位置?

我已经使用Spring Boot了几个星期,而且我习惯使用该application.properties文件.我可以使用它进行简单的部署并与java jar或一起使用mvn spring-boot:run.

现在我正在尝试将我的应用程序部署到Tomcat 8.0.15应用程序服务器.我一直在阅读文档,但我无法部署该war文件,因为Tomcat无法找到这个着名的application.properties文件.我的观点是,如果我想把这个文件war放在我的Tomcat安装中,我应该把它放在哪里自动读取?

java spring tomcat spring-boot

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

spring ×2

spring-boot ×2

java ×1

jpa ×1

tomcat ×1