I can successfully run my Grails application in Jetty. It succeeds in connecting to my MsSql database and everything is fine. When I deploy that same application in Tomcat 6 on the same machine, I receive the following error on startup in the Tomcat log:
Caused by: java.net.ConnectException: Connection refused: connect
I don't believe that my MsSql server is the issue since I have another Java application running in the same instance of Tomcat and accessing the same database server successfully.
The connection string is exactly the same when I deploy it in Jetty and in Tomcat. Any ideas why I can't connect to my database when I deploy my Grails app in Tomcat 6? I can't seem to access any databases when my Grails app deployed in Tomcat. (My other Java app (Confluence) has no problem connecting.
Here is my connection info:
dataSource {
pooled = true
driverClassName = "net.sourceforge.jtds.jdbc.Driver"
username = "user"
password = "pass"
}
hibernate {
cache.use_second_level_cache=true
cache.use_query_cache=true
cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "update" // one of 'create', 'create-drop','update'
url = "jdbc:jtds:sqlserver://localhost:1143/holidayCards"
}
}
test { //for AD-DEV02
dataSource {
dbCreate = "update"
url = "jdbc:jtds:sqlserver://AD-DEV02:1237/holidayCards;instance=SQL2005"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:jtds:sqlserver://SQL:1433/holidayCards"
}
}
}
I always deploy as 'test':
grails test war
As you'll see from my answer below, I don't think this is a connection issue since I was able to get to work successfully when I downgraded from grails 1.1beta1 to 1.0.4.
Any help is appreciated,
Andrew