简体   繁体   English

CloudException:找不到合适的云连接器

[英]CloudException: No suitable cloud connector found

My project has dependencies on spring-boot-starter-cloud-connectors and spring-cloud-localconfig-connector .我的项目依赖于spring-boot-starter-cloud-connectorsspring-cloud-localconfig-connector Here is my code:这是我的代码:

@Configuration
class MyConfig {

    @Bean
    public CloudFactory cloudFactory() {
        CloudFactory cf = new CloudFactory();
        cf.registerCloudConnector(new LocalConfigConnector());
        return cf;
    }

}

@Component
class MyComponent {

    @Autowired
    CloudFactory cf;

    @EventListener(value = ApplicationStartedEvent.class)
    public void postConstruct() {
        Cloud cloud = cf.getCloud();
    }

}

When I try to run the above code locally, I get an exception saying:当我尝试在本地运行上面的代码时,我得到一个异常说:

org.springframework.cloud.CloudException: No suitable cloud connector found org.springframework.cloud.CloudException:找不到合适的云连接器

Although, the parent's version is irrelevant but I am using 2.1.8.RELEASE .虽然,父母的版本无关紧要,但我使用的是2.1.8.RELEASE

Can someone point out what's wrong with the above code?有人可以指出上面的代码有什么问题吗?

You have to add the default datasource:您必须添加默认数据源:

mysql://user:password@localhost:3306/databasename

You can set it using the run configuration or create a seperate properties file for it.您可以使用运行配置对其进行设置或为其创建单独的properties文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 没有找到合适的云连接器 IntelliJ 中的错误与在 Eclipse 中工作 - No suitable cloud connector found Error in IntelliJ Vs Working in Eclipse 没有找到合适的ServiceConnectorCreator错误 - Spring cloud / CloudFoundry - No suitable ServiceConnectorCreator found error - Spring cloud/CloudFoundry 找不到合适的驱动程序。 Java JDBC mysql连接器 - No Suitable Driver Found. Java JDBC mysql connector Cloud SQL Postgres找不到适合的驱动程式jdbc:postgres:// google / - Cloud SQL Postgres No suitable driver found for jdbc:postgres://google/ java.sql.SQLException:找不到合适的驱动程序。 已经将连接器jar添加到Tomcat的lib文件夹中 - java.sql.SQLException: No suitable driver found. Already added connector jar to Tomcat's lib folder 在 Flink 中使用 mysql-connector-java:连接到 mysql >= 8.0.16 时找不到合适的驱动程序 - Using mysql-connector-java in Flink: No suitable driver found when connecting to mysql >= 8.0.16 No suitable driver found 错误 即使my-sql连接器上传到库中 - No suitable driver found error even if the my-sql connector uploaded into the library 找不到合适的默认RequestUpgradeStrategy - No suitable default RequestUpgradeStrategy found 找不到合适的构造函数(Java) - No Suitable Constructor Found (Java) 没有找到适合 java 的构造函数 - No suitable constructor found for java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM