grails run-war connects to mysql but grails run-war doesn't
Posted
by damian
on Stack Overflow
See other posts from Stack Overflow
or by damian
Published on 2010-04-01T23:20:26Z
Indexed on
2010/04/01
23:23 UTC
Read the original article
Hit count: 881
Hi,
I have a unexpected problem.
I had create a war with grails war. Then I had deployed in Tomcat.
For my surprise the crud works fine but I don't know what persistence is using.
So I did this test: Compare grails prod run-app with grails prod run-war. The first works fine, and does conect with the mysql database. The other don't.
This is my DataSource.groovy:
dataSource {
pooled = true
driverClassName = "com.mysql.jdbc.Driver"
username = "grails"
password = "mysqlgrails"
}
hibernate {
cache.use_second_level_cache=false
cache.use_query_cache=false
cache.provider_class='net.sf.ehcache.hibernate.EhCacheProvider'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "update" // one of 'create', 'create-drop','update'
url = "jdbc:mysql://some-key.amazonaws.com/MyDB"
}
}
test {
dataSource {
dbCreate = "update" // one of 'create', 'create-drop','update'
url = "jdbc:mysql://some-key.amazonaws.com/MyDB"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:mysql://some-key.amazonaws.com/MyDB"
}
}
}
Also I extract the war to see if I could find some data source configuration file without success.
More info: Grails version: 1.2.1 JVM version: 1.6.0_17
Also I think this question it's similar, but doesn't have a awnser.
© Stack Overflow or respective owner