我有spring引导应用程序,它在eclipse中运行良好。但不是在IntelliJ。由于IDE之间没有设置上的差异,eclipse可以很好地处理相同的代码,而不是IntelliJ。
IntelliJ:
May 18, 2021 6:13:31 PM org.springframework.cloud.localconfig.PropertiesFileResolver findCloudPropertiesFileFromClasspath
WARNING: the properties file spring-cloud-bootstrap.properties contained properties besides spring.cloud.propertiesFile; ignoring
May 18, 2021 6:13:31 PM org.springframework.cloud.localconfig.PropertiesFileResolver findCloudPropertiesFileFromClasspath
INFO: derived configuration file name: src\test\resources\local-service-info.properties
May 18, 2021 6:13:31 PM org.springframework.cloud.localconfig.PropertiesFileResolver findCloudPropertiesFile
INFO: using configuration file derived from spring-cloud-bootstrap.properties
May 18, 2021 6:13:31 PM org.springframework.cloud.localconfig.LocalConfigConnector readFileProperties
INFO: properties file src\test\resources\local-service-info.properties does not exist; probably running in a real cloud
May 18, 2021 6:13:31 PM org.springframework.cloud.localconfig.LocalConfigConnector isInMatchingCloud
INFO: the property spring.cloud.appId was not found in the system properties or configuration file
Exception in thread "main" org.springframework.cloud.CloudException: No suitable cloud connector found
at org.springframework.cloud.CloudFactory.getCloud(CloudFactory.java:55)
at com.comcast.xrm.video.vrs.collector.application.Application.main(Application.java:106)我见过其他与同样错误有关的帖子,也很少尝试设置。但没有运气。
我的主类包含新的CloudFactory().getCloud()代码;这是作为解决这个问题的解决方案而给出的
任何帮助都将不胜感激!谢谢
发布于 2021-05-19 15:52:37
我无法解释为什么这在中的工作方式不同。这可能是由于运行配置和查找文件src\test\resources\local-service-info.properties的能力不同造成的。
INFO: properties file src\test\resources\local-service-info.properties does not exist; probably running in a real cloud但是,您应该知道库是在维护模式,并且不鼓励使用它来支持较新的Java CFEnv库。
https://stackoverflow.com/questions/67594613
复制相似问题