Conexão ao Banco mysql
24/11/2013 13:56
| Running Grails application
| Error 2013-11-24 13:47:13,455 [localhost-startStop-1] ERROR context.GrailsCon
extLoader - Error initializing the application: Error creating bean with name
transactionManagerPostProcessor': Initialization of bean failed; nested excepti
n is org.springframework.beans.factory.BeanCreationException: Error creating be
n with name 'transactionManager': Cannot resolve reference to bean 'sessionFact
ry' while setting bean property 'sessionFactory'; nested exception is org.sprin
framework.beans.factory.BeanCreationException: Error creating bean with name 's
ssionFactory': Cannot resolve reference to bean 'hibernateProperties' while set
ing bean property 'hibernateProperties'; nested exception is org.springframewor
.beans.factory.BeanCreationException: Error creating bean with name 'hibernateP
operties': Cannot resolve reference to bean 'dialectDetector' while setting bea
property 'properties' with key [hibernate.dialect]; nested exception is org.sp
ingframework.beans.factory.BeanCreationException: Error creating bean with name
'dialectDetector': Invocation of init method failed; nested exception is org.sp
ingframework.jdbc.support.MetaDataAccessException: Error while extracting Datab
seMetaData; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsE
ception: Communications link failure
Last packet sent to the server was 0 ms ago.
Message: Error creating bean with name 'transactionManagerPostProcessor': Initi
lization of bean failed; nested exception is org.springframework.beans.factory.
eanCreationException: Error creating bean with name 'transactionManager': Canno
resolve reference to bean 'sessionFactory' while setting bean property 'sessio
Factory'; nested exception is org.springframework.beans.factory.BeanCreationExc
ption: Error creating bean with name 'sessionFactory': Cannot resolve reference
to bean 'hibernateProperties' while setting bean property 'hibernateProperties'
nested exception is org.springframework.beans.factory.BeanCreationException: E
ror creating bean with name 'hibernateProperties': Cannot resolve reference to
ean 'dialectDetector' while setting bean property 'properties' with key [hibern
te.dialect]; nested exception is org.springframework.beans.factory.BeanCreation
xception: Error creating bean with name 'dialectDetector': Invocation of init m
thod failed; nested exception is org.springframework.jdbc.support.MetaDataAcces
Exception: Error while extracting DatabaseMetaData; nested exception is com.mys
l.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.
Line | Method
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | 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 'transactionMana
er': Cannot resolve reference to bean 'sessionFactory' while setting bean prope
ty 'sessionFactory'; nested exception is org.springframework.beans.factory.Bean
reationException: Error creating bean with name 'sessionFactory': Cannot resolv
reference to bean 'hibernateProperties' while setting bean property 'hibernate
roperties'; nested exception is org.springframework.beans.factory.BeanCreationE
ception: Error creating bean with name 'hibernateProperties': Cannot resolve re
erence to bean 'dialectDetector' while setting bean property 'properties' with
ey [hibernate.dialect]; nested exception is org.springframework.beans.factory.B
anCreationException: Error creating bean with name 'dialectDetector': Invocatio
of init method failed; nested exception is org.springframework.jdbc.support.Me
aDataAccessException: Error while extracting DatabaseMetaData; nested exception
is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link
failure
Last packet sent to the server was 0 ms ago.
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | 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 'hibernateProperties' while setting bean prop
rty 'hibernateProperties'; nested exception is org.springframework.beans.factor
.BeanCreationException: Error creating bean with name 'hibernateProperties': Ca
not resolve reference to bean 'dialectDetector' while setting bean property 'pr
perties' with key [hibernate.dialect]; nested exception is org.springframework.
eans.factory.BeanCreationException: Error creating bean with name 'dialectDetec
or': Invocation of init method failed; nested exception is org.springframework.
dbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; n
sted exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Comm
nications link failure
Last packet sent to the server was 0 ms ago.
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | 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 'hibernateProper
ies': Cannot resolve reference to bean 'dialectDetector' while setting bean pro
erty 'properties' with key [hibernate.dialect]; nested exception is org.springf
amework.beans.factory.BeanCreationException: Error creating bean with name 'dia
ectDetector': Invocation of init method failed; nested exception is org.springf
amework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMe
aData; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsExcept
on: Communications link failure
Last packet sent to the server was 0 ms ago.
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | 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 'dialectDetector
: Invocation of init method failed; nested exception is org.springframework.jdb
.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nest
d exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communi
ations link failure
Last packet sent to the server was 0 ms ago.
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | 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; nes
ed exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Commun
cations link failure
Last packet sent to the server was 0 ms ago.
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | 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
Last packet sent to the server was 0 ms ago.
->> 406 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1074 | createCommunicationsException in com.mysql.jdbc.SQLError
| 2103 | createNewIO in com.mysql.jdbc.ConnectionImpl
| 718 | <init> in ''
| 46 | <init> . in com.mysql.jdbc.JDBC4Connection
| 406 | handleNewInstance in com.mysql.jdbc.Util
| 302 | getInstance in com.mysql.jdbc.ConnectionImpl
| 282 | connect in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | 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 ''
| 253 | connect . in com.mysql.jdbc.StandardSocketFactory
| 280 | <init> in com.mysql.jdbc.MysqlIO
| 2026 | createNewIO in com.mysql.jdbc.ConnectionImpl
| 718 | <init> in ''
| 46 | <init> . in com.mysql.jdbc.JDBC4Connection
| 406 | handleNewInstance in com.mysql.jdbc.Util
| 302 | getInstance in com.mysql.jdbc.ConnectionImpl
| 282 | connect in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | 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
dataSource {
pooled = true
driverClassName = "com.mysql.jdbc.Driver"
username = "root"
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" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:mysql://localhost:3306//projektor"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:mysql://localhost:3306//projektor"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:mysql://localhost:3306//projektor"
pooled = true
properties {
maxActive = -1
minEvictableIdleTimeMillis=1800000
timeBetweenEvictionRunsMillis=1800000
numTestsPerEvictionRun=3
testOnBorrow=true
testWhileIdle=true
testOnReturn=true
validationQuery="SELECT 1"
jdbcInterceptors="ConnectionState"
}
}
}
}
Para se registrar, clique aqui.