Как исправить Подходящий облачный соединитель не найден - PullRequest
0 голосов
/ 01 ноября 2019
  1. Я использую версию весенней загрузки 2.1.9, пытаясь перенести мой проект из весеннего boot1.x в 2.x.
  2. Я получаю следующее исключение при запуске приложения. Я добавил следующие зависимости, чтобы решить проблему
    <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-cloud-connectors</artifactId>
            </dependency>



     @Configuration
    public class CloudConfiguration {

        private Logger logger = LoggerFactory.getLogger(CloudConfiguration.class);

        private static final String CLOUD_PROP_NOT_FOUND = "Warning: Cloud properties are not loaded! ";


        @Bean(name="cloudFactoryProperties")
        public Properties loadCloudProperties() {
            Properties props = null;//new Properties();
            try {
                props = factory().getCloud().getCloudProperties();//getting exception here
                logger.info("Cloud properties : {}", props);
            } catch (Exception e) {
                logger.error("Exception while try to load the cloud properties");
            }
            if (props == null) {
                //logger.warn(CLOUD_PROP_NOT_FOUND);
            }
            return props;
        }

        private CloudFactory factory(){
            return new CloudFactory();
        }

        @Bean
        public RestTemplate restTemplate() {
            return new RestTemplate();
        }
    }

        I am getting this exception.
        org.springframework.cloud.CloudException: No suitable cloud 
        connector found at org.springframework.cloud.CloudFactory.getCloud(CloudFactory.java:55)
...