- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我又开始编写旧程序 https://github.com/JonkiPro/REST-Web-Services .我已将 Spring Boot 从 15.6 版更新到 2.0.0 版。我在编译时遇到了很多问题,但我无法处理一个。好吧,在编译过程中,他把我扔进了控制台
2018-03-18 21:54:53.339 ERROR 3220 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig : HikariPool-1 - jdbcUrl is required with driverClassName.
2018-03-18 21:54:55.392 INFO 3220 --- [ost-startStop-1] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'unit'
2018-03-18 21:54:56.698 INFO 3220 --- [ost-startStop-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'unit'
2018-03-18 21:54:56.778 ERROR 3220 --- [ost-startStop-1] com.zaxxer.hikari.HikariConfig : HikariPool-1 - jdbcUrl is required with driverClassName.
2018-03-18 21:54:56.782 ERROR 3220 --- [ost-startStop-1] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsService' defined in file [C:\Users\Jonatan\Documents\GitHub\REST-Web-Services\web\out\production\classes\com\web\web\security\service\impl\UserDetailsServiceImpl.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Cannot create inner bean '(inner bean)#65d6e77b' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#65d6e77b': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': Post-processing of FactoryBean's singleton object failed; nested exception is java.lang.IllegalArgumentException: jdbcUrl is required with driverClassName.
2018-03-18 21:54:56.821 WARN 3220 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
我从来没有犯过这样的错误。我完全不知道这意味着什么。我的基地属性如下所示
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql:database
username: root
password: root
schema: classpath:/db/init/schema.sql
我不知道如何处理这个错误。我已经编程了很长时间,但是我第一次遇到了 hikari
的概念。我正在使用 Tomcat(在 Spring Boot 中)服务器和 PostgreSQL 数据库。
最佳答案
我在另一个上下文中遇到了同样的问题。来自 79. Data Access - Configure a Custom DataSource
if you happen to have Hikari on the classpath, this basic setup does not work, because Hikari has no url property (but does have a jdbcUrl property)
Hikari 是 Spring Boot 2 中的默认池。
所以你可以替换配置url: jdbc:postgresql:database
-> jdbc-url: jdbc:postgresql:database
或者您可以保留配置,但您需要定义另一个 Bean 来处理映射(别名)
@Bean
@Primary
@ConfigurationProperties("app.datasource")
public DataSourceProperties dataSourceProperties() {
return new DataSourceProperties();
}
@Bean
@ConfigurationProperties("app.datasource")
public DataSource dataSource(DataSourceProperties properties) {
return properties.initializeDataSourceBuilder().
.build();
}
关于java - HikariPool-1 - driverClassName 需要 jdbcUrl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49352800/
我正在使用 HikariCP 运行 SQLite 数据库。我的配置如下所示: public class SQLiteDataSource { private static final Hika
我正在部署 Spring-Boot4 项目,但出现了一个名为 HikariPool-1 - Exception during pool initialization. 的错误 2019-07-05 1
所以我正在尝试建立连接但它不起作用并给了我这个很好的异常(我不太理解): 11:17:07 [SEVERE] java.sql.SQLException: HikariPool-1 - Interru
这个问题已经有答案了: Closing JDBC Connections in Pool (3 个回答) Best approach for returning connection objects
我有 Hikari 连接池,配置如下 HikariConfig hikariConfig = new HikariConfig(); hikariConfig.setJdbcUrl(d
所以我正在尝试建立连接但它不起作用并给了我这个很好的异常(我不太理解): 11:17:07 [SEVERE] java.sql.SQLException: HikariPool-1 - Interru
我将在我的 WEB 应用程序中使用 HikariCP 而不是 c3p0。好像, super 棒但对我来说,HikariCP 接口(interface)中仍然存在有问题的地方。它包含两个类 - Hika
这也许是一个非常简单的问题。如何禁用 Hikari-CP 调试日志?在我的日志文件中,我有很多这样的消息 DEBUG [.zaxxer.hikari.pool.HikariPool:] - Befor
我正在使用 HikariCP 2.4.7 作为连接池。启动应用程序后一切正常,但一段时间后没有调用 getConnection() 我在尝试 getConnection() 时收到此错误: java.
我正在使用 HikariCP 2.6.1。 我正在平静地使用 MySQL 和 JUnit 4.x。就在今天,我添加了一个新的 @Test 方法,但现在测试失败了。如果我将 @Ignore 放入这个新的
我又开始编写旧程序 https://github.com/JonkiPro/REST-Web-Services .我已将 Spring Boot 从 15.6 版更新到 2.0.0 版。我在编译时遇到
我在下面的配置 xml 映射中收到连接不可用错误消息。请告诉我我在 beolw 代码中做错了什么,或者这是另一个问题。根据我的调查,这是 HikariCP、Hibernate 和 Spring Bat
我在(Java8 + Oauth2 + MySql + Hazelcast +没有群集的http session )组合的生产方式下遇到错误。开发模式运行正常。 Unable to register
我正在尝试在 Tomcat 8.5 中使用 HikariCP JNDI 数据源工厂,但是当它关闭时,我收到以下警告: o.a.c.loader.WebappClassLoaderBase
Exception in thread "task-2" org.springframework.jdbc.datasource.init.UncategorizedScriptException:
我有一个用于测试目的的小型 Java 应用程序。我最近搬到了hikari。我注意到我不断收到此错误。 java.sql.SQLTransientConnectionException: HikariP
由于 Hikari 池初始化异常,我无法部署 Spring boot 2 应用程序。 错误日志是 com.zaxxer.hikari.pool.HikariPool - HikariPool-1 -
我正在使用 Postgresql 和 spring boot 2.0.4。尝试一个接一个地执行查询时会引发以下错误。我执行了以下查询,并且计数不断增加。 SELECT COUNT(*) FROM pg
HikariPool-1 - Connection marked as broken because of SQLSTATE(08S01), ErrorCode(-99999) java.sql.SQ
我正在使用 Spring Boot 和 Hibernate 创建一个简单的 Maven 项目,我想使用 Hibernate 在 mysqlDB 中创建我的表。当我运行 Spring 应用程序时,它不会
我是一名优秀的程序员,十分优秀!