title: No suitable cloud connector found while trying to use local spring cloud connector/local_configuration_connector
body: <p>I am trying to use the local cloud spring connector to test my application in local environment before it can be deployed to CF based cloud environment. From the Spring link </p>
  
  <p><a href="http://cloud.spring.io/spring-cloud-connectors/spring-cloud-connectors.html#_local_configuration_connector" rel="nofollow noreferrer">http://cloud.spring.io/spring-cloud-connectors/spring-cloud-connectors.html#_local_configuration_connector</a></p>
  
  <p>I followed the process and created properties file with the name spring-cloud-bootstrap.properties in project resource directory. It has the following content</p>
  
  <p>spring.cloud.propertiesFile: C:\Users\IBM_ADMIN\git\ServiceXchange5\ServiceXchange\spring-cloud.properties</p>
  
  <p>I do have the file spring-cloud.properties in the path given above. </p>
  
  <p>From the spring configuaration bean I have the following </p>
  
  <pre><code>@EnableWebMvc
  @Configuration
  @EnableAspectJAutoProxy
  public class CloudServiceConfig extends AbstractCloudConfig {
  
  @Bean
  public DataSource getDataSource() throws AppException  {
  
  org.springframework.cloud.service.PooledServiceConnectorConfig.PoolConfig poolConfig = new PoolConfig(50, 100, 3000);
  org.springframework.cloud.service.relational.DataSourceConfig dbConfig = new DataSourceConfig(poolConfig, null);
  return connectionFactory().dataSource(SX_DB_USED, dbConfig);
  
  }
  </code></pre>
  
  <p>Now this DataSource bean is injected in various other places. With the property files in places, I expect that cloud connector bean for local configuration  will be created and I should be able to use the same to add more configuration for DataSource for connection pooling.</p>
  
  <p>However when I access the application it seems local Configuration connector itself it not activated. </p>
  
  <pre><code>Initialization of bean failed; nested exception is org.springframework.cloud.CloudException: No suitable cloud connector found
  [ERROR   ] SRVE0271E: Uncaught init() exception created by servlet [appServlet] in application [ServiceXchange]:  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cloudServiceConfig' defined in file [C:\Users\IBM_ADMIN\git\ServiceXchange5\ServiceXchange\target\classes\com\hcl\service\config\CloudServiceConfig.class]: Initialization of bean failed; nested exception is org.springframework.cloud.CloudException: No suitable cloud connector found
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
  at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839)
  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538)
  at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
  at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
  at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
  at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2388)
  at [internal classes]
  Caused by: org.springframework.cloud.CloudException: No suitable cloud connector found
  at org.springframework.cloud.CloudFactory.getCloud(CloudFactory.java:55)
  at org.springframework.cloud.config.java.AbstractCloudConfig.setBeanFactory(AbstractCloudConfig.java:85)
  at com.hcl.service.config.CloudServiceConfig$$EnhancerBySpringCGLIB$$9529c032.CGLIB$setBeanFactory$54(&lt;generated&gt;)
  at com.hcl.service.config.CloudServiceConfig$$EnhancerBySpringCGLIB$$9529c032$$FastClassBySpringCGLIB$$6c6301dd.invoke(&lt;generated&gt;)
  at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
  at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanFactoryAwareMethodInterceptor.intercept(ConfigurationClassEnhancer.java:277)
  at com.hcl.service.config.CloudServiceConfig$$EnhancerBySpringCGLIB$$9529c032.setBeanFactory(&lt;generated&gt;)
  at org.springframework.context.annotation.ConfigurationClassPostProcessor$EnhancedConfigurationBeanPostProcessor.postProcessPropertyValues(ConfigurationClassPostProcessor.java:480)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543)
  ... 13 more
  </code></pre>
  
  <p>I am not sure why the local cloud connector is not activated. As per the link it should after detecting the properties files in place.</p>
  
  <p>NOTE : I have tried putting the property file in different location like (directly under application root, in web-inf/lib, in resources etc)</p>
  
  <p>Any help here ?</p>