I can successfully run the Grails application in Jetty. He manages to connect to my MsSql database, and everything is fine. When I deploy the same application to Tomcat 6 on the same computer, I get the following error when starting in Tomcat log:
Caused by: java.net.ConnectException: Connection refused: connect
I do not think that my MsSql server is a problem, since I have another Java application running on the same Tomcat instance and accessing the same database server successfully.
The connection string is exactly the same when I deploy it to Jetty and Tomcat. Any ideas why I can't connect to my database when deploying a Grails application to Tomcat 6? It seems I canโt access the databases when the Grails application was deployed to Tomcat. (My other Java application (Confluence) has no connectivity issues.
Here is my connection information:
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 use the "test":
grails test war
As you will see from my answer below, I do not think this is a connection problem, since I was able to work successfully when I lowered the level from grails 1.1beta1 to 1.0.4 .
Any help is appreciated
Andrew
source share