cf-toolsuite / cf-butler

My purpose in life is to cleanup stale apps and services on a Cloud Foundry foundation. I can be configured to report on and remove orphaned services and stopped app instances older than a configurable duration. I do many other useful things too.
Apache License 2.0
42 stars 16 forks source link

Deploying to PCF with RDS mysql #163

Closed lerytke closed 4 years ago

lerytke commented 4 years ago

2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT Caused by: java.lang.IllegalStateException: Unable to create a ConnectionFactory for 'ConnectionFactoryOptions{options={database=, password=REDACTED, user=, host=, port=3306, driver=mysql}}'. Available drivers: [ h2, postgresql ]

when I build the app I used the ./gradlew -b build.w-mysql.gradle but it looks like the mysql driver is missing

2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory' defined in class path resource [io/pivotal/cfapp/config/CloudConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.r2dbc.spi.ConnectionFactory]: Factory method 'connectionFactory' threw exception; nested exception is java.lang.IllegalStateException: Unable to create a ConnectionFactory for 'ConnectionFactoryOptions{options={database=my_848658d67c874, password=REDACTED, user=my_aab977c7ca364, host=cf-848658d6-7c87-4e33-9526-8c0d116a0cdb.c26jraliffm9.us-east-1.rds.amazonaws.com, port=3306, driver=mysql}}'. Available drivers: [ h2, postgresql ] 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:638) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:468) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1326) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1165) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1276) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1196) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:868) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:771) 2020-02-11T15:30:15.64-0500 [APP/PROC/WEB/0] OUT ... 27 more

lerytke commented 4 years ago

it seems that if you build with this command it works ./gradlew build -b build.w-mysql.gradle

pacphi commented 4 years ago

Thanks for catching this. I updated README, https://github.com/pacphi/cf-butler/blob/master/README.md#alternative-build-with-mysql-support