0

I'm using the cloud foundry plugin. I have set my credentials in Config.groovy. Can you tell me more about the errors I get?

Application Deployed URL: 'sqr-gb-ks.cloudfoundry.com'
> 
Would you like to create and bind a mysql service?[y,n] > Invalid input. Must be one of [y,n] y
Service 'mysql-8a02c10' provisioned.
> 
Would you like to create and bind a postgresql service?[y,n] > Invalid input. Must be one of [y,n] y
Service 'postgresql-d6ab9c9' provisioned.
| Creating application sqr-gb-ks at sqr-gb-ks.cloudfoundry.com with 1024MB and services [mysql-8a02c10, postgresql-d6ab9c9]: OK
| Uploading Application:
|   Checking for available resources: OK
|   Processing resources: OK
|   Packing application: OK
|   Uploading (50K): OK
| Trying to start Application: 'sqr-gb-ks'.....
| Error ERROR - Application 'sqr-gb-ks' failed to start, logs information below.
==== logs/stderr.log ====

Oct 22, 2012 4:57:47 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-25918
Oct 22, 2012 4:57:47 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 403 ms
Oct 22, 2012 4:57:47 PM org.apache.catalina.realm.JAASRealm setContainer
INFO: Set JAAS app name Catalina
Oct 22, 2012 4:57:47 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Oct 22, 2012 4:57:47 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.35
Oct 22, 2012 4:57:47 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Oct 22, 2012 4:58:10 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Oct 22, 2012 4:58:10 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [] startup failed due to previous errors
Oct 22, 2012 4:58:10 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak.
Oct 22, 2012 4:58:10 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [net.sf.ehcache.CacheManager@403525a2] but has failed to stop it. This is very likely to create a memory leak.

==== logs/stdout.log ====

[  Envjs/1.6 (Rhino; U; Linux amd64 2.6.38-15-virtual; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13  ]
[  Envjs/1.6 (Rhino; U; Linux amd64 2.6.38-15-virtual; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13  ]
[  Envjs/1.6 (Rhino; U; Linux amd64 2.6.38-15-virtual; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13  ]
[  Envjs/1.6 (Rhino; U; Linux amd64 2.6.38-15-virtual; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13  ]
Stopping Tomcat because the context stopped.
Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156

2 Answers2

1

If it's a Grails app you should use the http://grails.org/plugin/cloud-foundry plugin instead of STS since it has an awareness of the Spring beans for JDBC, MongoDB, Redis, etc. and will reconfigure them automatically for you on deployment. See the docs here: http://grails-plugins.github.com/grails-cloud-foundry/docs/manual/index.html

Also - do you really want both a MySQL and a PostgreSQL database? You should probably pick one :)

You can see the actual problem by looking at stacktrace.log and the "localhost" log in the tomcat/logs directory on the server - that's where the real stacktrace and error messages will be, not in the stdout that you see when deploying.

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
  • I did use the cloud-foundry plugin, but you're right : I messed it up with the db services!My stacktrace.log file is empty. How to access the tomcat/logs? Thanks for helping but still an error.There is something wrong with my mysql dependencies, I typed grails install-dependency mysql:mysql-connector-java:5.1.16 --dir=lib but then also commented out the line in BuildConfig.groovy runtime 'mysql:mysql-connector-java:5.1.20'. How to delete the lib directory with the jar? – Guillaume Barthe Oct 23 '12 at 07:32
  • A new project. A little bit "better"! Still errors: SEVERE: Error listenerStart Oct 23, 2012 8:32:49 AM org.apache.catalina.core.StandardContext start SEVERE: Context [] startup failed due to previous errors Oct 23, 2012 8:32:49 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads Oct 23, 2012 8:32:49 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [net.sf.ehcache.CacheManager@21397218] ==== logs/stdout.log ==== Stopping Tomcat because the context stopped. – Guillaume Barthe Oct 23 '12 at 08:38
1

Thanks to my friend bertrand from odelia technologies, I succeeded in pushing my app to the cloud.I turned off one of the plugins I added and ran the command : grails cf-bind-service mysql-f1..(I had not done it!) Then I had to modify my DataSource.groovy;

 production {
            dataSource {
                dialect= org.hibernate.dialect.MySQLInnoDBDialect
                driverClassName = "com.mysql.jdbc.Driver"
                    dbCreate = "update"
                username = "n/a"
                password = "n/a"
                url = "n/a"            
             }
     }