2

I'm trying to deploy my Spring Boot based application to a CloudControl container. I've added the mysql.free add-on and configured it through my application.properties:

spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.max-active=1
spring.datasource.max-idle=1
spring.datasource.min-idle=1
spring.datasource.initial-size=1

spring.datasource.url=jdbc:mysql://${MYSQLS_HOSTNAME}:${MYSQLS_PORT}/${MYSQLS_DATABASE}
spring.datasource.username=${MYSQLS_USERNAME}
spring.datasource.password=${MYSQLS_PASSWORD}

On my local development system, everything works perfectly fine, but on the CloudControl container, the app won't start.

I added the StackTrace here. I'm trying to solve the problem for days, but I am not able to solve it by my own.

geoand
  • 60,071
  • 24
  • 172
  • 190
mhmpl
  • 1,045
  • 2
  • 13
  • 29
  • 1
    Are you sure that the environmental variables like `MYSQLS_HOSTNAME` are set in the production environment? – geoand Aug 17 '14 at 17:25
  • Yes definitely, I just tried it again, and it is set... – mhmpl Aug 17 '14 at 17:33
  • 1
    I propose you use the DEBUG log level to help you out with what's going on – geoand Aug 17 '14 at 17:34
  • 1
    Can you add more details like, how spring configuration file is setup? how properties file is referenced? where application.properties is exactly located? etc. It will help to point exact error. – CuriousMind Aug 17 '14 at 18:19
  • My `application.properties` file looks exactly like above. It is placed in `resources/config`. I don't think that the problem is based in my config file, because when I output for example the value of `spring.datasource.url` the connection string is correct. – mhmpl Aug 18 '14 at 05:36

1 Answers1

3

Spring apps are very memory consuming and the mysqls.free addon allows only a limited number of parallel connections. Although your Stacktrace doesn't show any of these problems. It's hard to solve this issue without more context like logs or environment settings. The following commands may help:

cctrlapp app_name/default log error   # shows startup log
cctrlapp app_name/default addon.creds # shows DB credentials

I've uploaded some spring-boot example code at https://github.com/cloudControl/spring-boot-example-app which I've tested on cloudControl today. Please take a look at the configuration there. If you want to deploy it, make sure your container has memory size >= 768mb.

cctrlapp app_name/default deploy --memory 768MB

If you still have issues, please contact cloudControl support to help you.

alpe1
  • 350
  • 1
  • 9