我正在使用spring-cloud-starter-consul-config'. For this I defined my properties inbootstrap.yml. But I need to use profile specific consul properties which is not working inbootstrap.yml`.
此外,我需要使用自定义属性文件而不是bootstrap.yml,以便可以使用@PropertySource加载此自定义文件。有什么想法吗?
@SpringBoogApplication
@EnableAutoconfigur
我正在尝试为我的一个项目配置。它以前很好用。然而,使用最新版本的Spring,当我试图启用身份验证时,我陷入了麻烦。这是我看到的原木。
INFO Fetching config from server at : http://localhost:8888
WARN Could not locate PropertySource: Could not extract response: no suitable HttpMessageConverter found for response type [class org.springframework.cloud.config.environ
我使用mvn package创建了Spring项目的fat jar。在/resources/bootstrap.yml内部,我试图访问一个也在/resources下的文件。
location: classpath:secret.json**.**
bootstrap.yml和secret.json都在/resources包中。
但我得到了java.io.FileNotFoundException: class path resource [secret.json] cannot be resolved to absolute file path because it does not resi
我正在尝试从Spring Edgware.SR2升级到Edgware.SR3。当我构建时,ApplicationTests中的默认ApplicationTests测试会失败,出现以下错误:
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'encryptionBootstrapConfiguration': Unsatisfied dependency expressed through field 'en
./gradlew build失败,在运行:test任务时在底部给出错误。代码只是检查上下文是否正确加载。
@RunWith(SpringRunner.class)
@SpringBootTest
@ContextConfiguration
public class RegistryApplicationTests {
@Test
public void contextLoads() {
}
}
下面给出了bootstrap.yml文件(非常标准),我不知道它为什么要从云-配置服务加载属性文件,我该如何绕过它呢?
spring:
application:
na