gpt4 book ai didi

mysql - Grails 无法创建池的初始连接

转载 作者:行者123 更新时间:2023-11-30 23:47:41 25 4
gpt4 key购买 nike

当我运行我的 Grails 应用程序时出现以下错误

| Loading Grails 2.3.5
| Configuring classpath
| Configuring classpath.
| Environment set to development
| Environment set to development.
| Environment set to development..
| Environment set to development...
| Environment set to development....
| Environment set to development.....
| Packaging Grails application
| Packaging Grails application.
| Packaging Grails application..
| Packaging Grails application...
| Packaging Grails application....
| Packaging Grails application.....
| Compiling 1 source files
| Compiling 1 source files.
| Compiling 1 source files..
| Compiling 1 source files...
| Compiling 1 source files....
| Compiling 1 source files.....
| Running Grails application
| Error 2015-04-21 11:54:24,947 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool .
Message: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Line | Method
->> 411 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1121 | createCommunicationsException in com.mysql.jdbc.SQLError
| 676 | readPacket . . . . . . . . . in com.mysql.jdbc.MysqlIO
| 1088 | doHandshake in ''
| 2493 | coreConnect . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly in ''
| 2311 | createNewIO . . . . . . . . . in ''
| 834 | <init> in ''
| 47 | <init> . . . . . . . . . . . in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 416 | getInstance . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 347 | connect in com.mysql.jdbc.NonRegisteringDriver
| 262 | run . . . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpecte dly>
>->> 3166 | readFully in com.mysql.jdbc.MysqlIO>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >| 600 | readPacket in ''
| 1088 | doHandshake . . . . . . . . . in ''
| 2493 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly . . . . . . in ''
| 2311 | createNewIO in ''
| 834 | <init> . . . . . . . . . . . in ''
| 47 | <init> in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance . . . . . . in com.mysql.jdbc.Util
| 416 | getInstance in com.mysql.jdbc.ConnectionImpl
| 347 | connect . . . . . . . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . . . . . . . . . . . in java.lang.Thread
| Error 2015-04-21 11:54:25,051 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool .
Message: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Line | Method
->> 411 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1121 | createCommunicationsException in com.mysql.jdbc.SQLError
| 676 | readPacket . . . . . . . . . in com.mysql.jdbc.MysqlIO
| 1088 | doHandshake in ''
| 2493 | coreConnect . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly in ''
| 2311 | createNewIO . . . . . . . . . in ''
| 834 | <init> in ''
| 47 | <init> . . . . . . . . . . . in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 416 | getInstance . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 347 | connect in com.mysql.jdbc.NonRegisteringDriver
| 262 | run . . . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpecte dly>
>->> 3166 | readFully in com.mysql.jdbc.MysqlIO>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >| 600 | readPacket in ''
| 1088 | doHandshake . . . . . . . . . in ''
| 2493 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly . . . . . . in ''
| 2311 | createNewIO in ''
| 834 | <init> . . . . . . . . . . . in ''
| 47 | <init> in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance . . . . . . in com.mysql.jdbc.Util
| 416 | getInstance in com.mysql.jdbc.ConnectionImpl
| 347 | connect . . . . . . . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . . . . . . . . . . . in java.lang.Thread
| Error 2015-04-21 11:54:25,139 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool .
Message: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Line | Method
->> 411 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1121 | createCommunicationsException in com.mysql.jdbc.SQLError
| 676 | readPacket . . . . . . . . . in com.mysql.jdbc.MysqlIO
| 1088 | doHandshake in ''
| 2493 | coreConnect . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly in ''
| 2311 | createNewIO . . . . . . . . . in ''
| 834 | <init> in ''
| 47 | <init> . . . . . . . . . . . in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 416 | getInstance . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 347 | connect in com.mysql.jdbc.NonRegisteringDriver
| 262 | run . . . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpecte dly>
>->> 3166 | readFully in com.mysql.jdbc.MysqlIO>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >| 600 | readPacket in ''
| 1088 | doHandshake . . . . . . . . . in ''
| 2493 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly . . . . . . in ''
| 2311 | createNewIO in ''
| 834 | <init> . . . . . . . . . . . in ''
| 47 | <init> in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance . . . . . . in com.mysql.jdbc.Util
| 416 | getInstance in com.mysql.jdbc.ConnectionImpl
| 347 | connect . . . . . . . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . . . . . . . . . . . in java.lang.Thread
| Error 2015-04-21 11:54:25,169 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: Err>
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. >Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org .spr
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. > Line | Method>->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFac tor>
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. >->> 262 | run in java.util.concurrent.FutureTask>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'lobHandlerDete cto>
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. >->> 262 | run in java.util.concurrent.FutureTask>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exc ept>
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. >->> 262 | run in java.util.concurrent.FutureTask>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is com.mysql.jdbc.exceptions.jdbc4.C omm>
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. >->> 262 | run in java.util.concurrent.FutureTask>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
->> 411 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1121 | createCommunicationsException in com.mysql.jdbc.SQLError
| 676 | readPacket in com.mysql.jdbc.MysqlIO
| 1088 | doHandshake in ''
| 2493 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly in ''
| 2311 | createNewIO in ''
| 834 | <init> in ''
| 47 | <init> . in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 416 | getInstance in com.mysql.jdbc.ConnectionImpl
| 347 | connect in com.mysql.jdbc.NonRegisteringDriver
| 262 | run . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpecte dly>
>->> 3166 | readFully in com.mysql.jdbc.MysqlIO>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 600 | readPacket in ''
| 1088 | doHandshake in ''
| 2493 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly in ''
| 2311 | createNewIO in ''
| 834 | <init> . in ''
| 47 | <init> in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 416 | getInstance in com.mysql.jdbc.ConnectionImpl
| 347 | connect . in com.mysql.jdbc.NonRegisteringDriver
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
| Error Forked Grails VM exited with error
| Server running. Browse to http://localhost:8080/TestDebug

我的代码如下:

dataSource {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
// cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
}

// environment specific settings
environments {
development {
dataSource {
dbCreate = "update"
url = "jdbc:mysql://localhost/nuage_v3"
driverClassName = "com.mysql.jdbc.Driver"
dialect = org.hibernate.dialect.MySQL5InnoDBDialect
username = "root"
password = "root"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
properties {
maxActive = -1
minEvictableIdleTimeMillis=1800000
timeBetweenEvictionRunsMillis=1800000
numTestsPerEvictionRun=3
testOnBorrow=true
testWhileIdle=true
testOnReturn=false
validationQuery="SELECT 1"
jdbcInterceptors="ConnectionState"
}
}
}
}

用户和密码都正确,我试过重装MySQL。

最佳答案

我已经放弃尝试解决问题。我在不同的机器上重新安装了 grails 和 mysql,它似乎可以工作。很抱歉打扰了大家。谢谢。

关于mysql - Grails 无法创建池的初始连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29769281/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com