in Education by
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 JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
What does your DataSource.groovy file look like? When you run your app with 'grails run-app', Grails uses the datasource in the "development" section. When you produce a war file with 'grails war' and deploy it to an application server, Grails uses the datasource in the "production" section. You may need to make sure that your development and production datasource are configure the same.

Related questions

0 votes
    I'm trying to use createCriteria with OR on two nested objects. This is the code I'm working with ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    i want to access the inList-values which i set in domain, in my view. Like this: But it dont ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 10, 2022 in Education by JackTerrance
0 votes
    i am working on a MVC project in java. For my operation I use database many times. many times my ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 7, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 6, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    I have a multi-threaded program whereas each thread, at the start of execution, acquires a single connection ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 5, 2022 in Education by JackTerrance
0 votes
    The account used to make the database connection must have______ privilege. (1)Admin (2)Least (3)Highest...
asked May 13, 2021 in Technology by JackTerrance
0 votes
    A database connection defined in Repository can be reused by any Job within the project. True False...
asked Mar 25, 2021 in Technology by JackTerrance
0 votes
    Can't ping smtp.gmail.com. I've been using google smtp for email notification and it was working ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    Using Eclipse 3.6SR2 and the appropriate Google Plugin I create a new Web Application Project. Everything ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    Imagine that you have come up with an AI based prediction model which has been deployed on the roads to check ... the above situation. Select the correct answer from above options...
asked Nov 12, 2021 in Education by JackTerrance
...