Veeramanikandan S
04/03/2024, 5:44 AMdataSource {
pooled = true
jmxExport = true
// driverClassName = "com.mysql.jdbc.Driver" // MySQL 5.7
driverClassName = "com.mysql.cj.jdbc.Driver" // MySQL 8.0
}
hibernate {
cache.use_second_level_cache = false
cache.use_query_cache = false
// cache.region.factory_class = 'org.hibernate.cache.SingletonEhCacheRegionFactory' // MySQL 5.7
cache.region.factory_class = 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory' // MySQL 8.0
singleSession = true // configure OSIV singleSession mode
flush.mode = 'auto' // OSIV session flush mode outside of transactional context
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "validate"
url = "jdbc:<mysql://localhost:3306/learn_around?useUnicode=true&characterEncoding=utf8>" // MySQL 5.7
// url = "jdbc:<mysql://localhost:3308/mig_learn_around?useUnicode=true&characterEncoding=utf8>" // MySQL 8.0
username = "root"
password = "ard5050"
}
}
}
BuildConfig.groovy
dependencies {
// <https://mvnrepository.com/artifact/mysql/mysql-connector-java>
// runtime 'mysql:mysql-connector-java:5.1.49'
runtime 'mysql:mysql-connector-java:8.0.33'
}
plugins {
// runtime ":hibernate:3.6.10.18"
runtime ":hibernate4:4.3.10"
}giangio
04/03/2024, 11:16 AMVeeramanikandan S
04/03/2024, 4:26 PMdriverClassName = "com.mysql.jdbc.Driver" // MySQL 5.7
cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // MySQL 5.7Veeramanikandan S
04/03/2024, 4:37 PMdriverClassName = "com.mysql.jdbc.Driver" // MySQL 5.7
cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // MySQL 5.7
url = "jdbc:<mysql://localhost:3306/learn_around?useUnicode=true&characterEncoding=utf8>" // MySQL 5.7
BuildConfig.groovy
runtime 'mysql:mysql-connector-java:5.1.29'
runtime ":hibernate4:4.3.10"
I am getting error that supposed occur:
2024-04-03 21:59:51,382 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - 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': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing table: book
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': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing table: book
But when I use the following connector
runtime 'mysql:mysql-connector-java:8.0.33'
Getting this. The point is app started without the table book (Note that this table exists in a DB that not learn_around
Error |
Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
|Server running. Browse to <http://localhost:8080/cl_migrate>giangio
04/04/2024, 8:39 AMVeeramanikandan S
04/04/2024, 8:42 AMgrails clean and grails clean-allAnuradha Bhan
04/22/2024, 1:18 PMVeeramanikandan S
04/22/2024, 1:20 PMdependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
// <https://mvnrepository.com/artifact/mysql/mysql-connector-java>
runtime 'mysql:mysql-connector-java:8.0.33'
}
plugins {
// runtime ":hibernate:3.6.10.19"
runtime ":hibernate4:4.3.10"
}Veeramanikandan S
04/22/2024, 1:22 PMdataSource {
pooled = true
jmxExport = true
// Set the MySQL 8 driver class name
// driverClassName = "com.mysql.jdbc.Driver"
driverClassName = "com.mysql.cj.jdbc.Driver"
// Set the dialect for MySQL 8
// dialect = 'org.hibernate.dialect.MySQL8Dialect' #removed this because of Hibernate version bundled with Grails 2.5.6 does not recognize MySQL8Dialect as it predates MySQL 8.
// The dialect below is compatible with MySQL 5.x and 8.x
dialect = 'org.hibernate.dialect.MySQL5InnoDBDialect'
//dialect = "com.domain.mysql.dialect.MySQLUTF8InnoDBDialect" for UTF-8 handling
//dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
//logSql = true
//formatSql = true
}
hibernate {
cache.use_second_level_cache = false // as per existing datasource.
cache.use_query_cache = false
// cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // MySQL 5.7
// cache.region.factory_class = 'org.hibernate.cache.SingletonEhCacheRegionFactory' // Hibernate 3
cache.region.factory_class = 'org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory' // Hibernate 4
singleSession = true // configure OSIV singleSession mode
flush.mode = 'auto' // OSIV session flush mode outside of transactional context
}Veeramanikandan S
04/22/2024, 1:24 PMAnuradha Bhan
04/22/2024, 1:26 PMAnuradha Bhan
04/24/2024, 1:43 PMVeeramanikandan S
04/24/2024, 1:45 PM