2014-05-03 108 views
0

我有這個錯誤,我不知道如何解決它,爲什麼發生。我使用的是grails 2.2.4和jdk 1.7.0。我顯然做錯了什麼。我忘了做什麼?如何解決這個grails錯誤?它是關於什麼?

希望得到一些指導。

| Error 2014-05-03 21:13:11,796 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'lobHandlerDetector' while setting bean property 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (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.) 
Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'lobHandlerDetector' while setting bean property 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (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 
->> 262 | run  in java.util.concurrent.FutureTask 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 724 | run  in java.lang.Thread 
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'lobHandlerDetector' while setting bean property 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (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.) 
->> 262 | run  in java.util.concurrent.FutureTask 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 724 | run  in java.lang.Thread 
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'lobHandlerDetector' while setting bean property 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (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.) 
->> 262 | run  in java.util.concurrent.FutureTask 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 724 | run  in java.lang.Thread 
Caused by BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (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.) 
->> 262 | run  in java.util.concurrent.FutureTask 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 724 | run  in java.lang.Thread 
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (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.) 
->> 262 | run  in java.util.concurrent.FutureTask 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 724 | run  in java.lang.Thread 
Caused by SQLNestedException: Cannot create PoolableConnectionFactory (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.) 
->> 1549 | createPoolableConnectionFactory in org.apache.commons.dbcp.BasicDataSource 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 1388 | createDataSource in  '' 
| 1044 | getConnection in  '' 
| 262 | run  in java.util.concurrent.FutureTask 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 724 | 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 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 1117 | createCommunicationsException in com.mysql.jdbc.SQLError 
| 350 | <init> . in com.mysql.jdbc.MysqlIO 
| 2408 | coreConnect in com.mysql.jdbc.ConnectionImpl 
| 2445 | connectOneTryOnly in  '' 
| 2230 | createNewIO in  '' 
| 813 | <init> . in  '' 
|  47 | <init> in com.mysql.jdbc.JDBC4Connection 
| 411 | handleNewInstance in com.mysql.jdbc.Util 
| 399 | getInstance in com.mysql.jdbc.ConnectionImpl 
| 334 | connect . in com.mysql.jdbc.NonRegisteringDriver 
|  38 | createConnection in org.apache.commons.dbcp.DriverConnectionFactory 
| 582 | makeObject in org.apache.commons.dbcp.PoolableConnectionFactory 
| 1556 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource 
| 1545 | createPoolableConnectionFactory in  '' 
| 1388 | createDataSource in  '' 
| 1044 | getConnection in  '' 
| 262 | run  in java.util.concurrent.FutureTask 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run  in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 724 | run . . . in java.lang.Thread 
Caused by ConnectException: Connection refused: connect 
->> 79 | socketConnect in java.net.DualStackPlainSocketImpl 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 339 | doConnect in java.net.AbstractPlainSocketImpl 
| 200 | connectToAddress in  '' 
| 182 | connect in  '' 
| 172 | connect . in java.net.PlainSocketImpl 
| 392 | connect in java.net.SocksSocketImpl 
| 579 | connect . in java.net.Socket 
| 528 | connect in  '' 
| 425 | <init> . in  '' 
| 241 | <init> in  '' 
| 259 | connect . in com.mysql.jdbc.StandardSocketFactory 
| 300 | <init> in com.mysql.jdbc.MysqlIO 
| 2408 | coreConnect in com.mysql.jdbc.ConnectionImpl 
| 2445 | connectOneTryOnly in  '' 
| 2230 | createNewIO in  '' 
| 813 | <init> in  '' 
|  47 | <init> . in com.mysql.jdbc.JDBC4Connection 
| 411 | handleNewInstance in com.mysql.jdbc.Util 
| 399 | getInstance in com.mysql.jdbc.ConnectionImpl 
| 334 | connect in com.mysql.jdbc.NonRegisteringDriver 
|  38 | createConnection in org.apache.commons.dbcp.DriverConnectionFactory 
| 582 | makeObject in org.apache.commons.dbcp.PoolableConnectionFactory 
| 1556 | validateConnectionFactory in org.apache.commons.dbcp.BasicDataSource 
| 1545 | createPoolableConnectionFactory in  '' 
| 1388 | createDataSource in  '' 
| 1044 | getConnection in  '' 
| 262 | run . . . in java.util.concurrent.FutureTask 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker 
^ 724 | run  in java.lang.Thread 

回答

0

雖然這個錯誤不一定是關於Grails的。 Grails正在冒泡它從另一層遇到的東西。當你閱讀的例外,你看它會有點像這樣:

  • Grails的
  • 春豆
  • 的Apache DBCP
  • MySQL的
  • java.net

在問題的根源在於:

Caused by ConnectException: Connection refused: connect

您正在嘗試連接到未在該端口上偵聽的服務器。檢查遠程主機名和端口的配置文件,並確認服務器正在運行並在那裏監聽。

相關問題