腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
Spring
Boot
@
ConfigurationProperties
with
config
server
?
、
、
有许多关于如何使用@
ConfigurationProperties
和@PropertySource的示例,其中配置位于.properties或.yml文件中。如何更改代码,使其改为使用配置服务器?我的代码当前在每个变量上使用@Value都能正常工作,但在切换到该类上的@
ConfigurationProperties
时就不能正常工作。
浏览 10
提问于2018-02-17
得票数 3
2
回答
传递多个外部配置文件的java jar -D选项
我有两个配置文件,必须使用
spring
boot
应用程序读取,然而,只有第一个配置属性文件被解析(external_application.properties),后一个(queries_
config
.propertiesjava -Dexternal.app.properties=file:external_application.properties -Dqueries.
config
.properties=file:queries_
config
.properties -jar testsnapshot
浏览 3
提问于2020-08-14
得票数 1
1
回答
Spring
@PropertySource动态设置路径
、
我正在使用
Spring
开发Core.And应用程序,这个应用程序将作为可执行的Core.And工作。
浏览 1
提问于2017-09-12
得票数 2
回答已采纳
1
回答
在
Spring
Boot
中访问外部配置的好做法是什么?
、
、
、
、
我正在设置一个
Spring
Boot
应用程序,其中某些配置是从我的应用程序.yaml-file中读取的。现在,提取配置的类被简单地定义为如下所示的组件: @Component@
ConfigurationProperties
("myPrefix只是我见过一些例子,比如像这样的配置被作为单例来处理(尽管不是在
Spring
-
Boot
环境中)。我只想问一下,是否有一些普遍接受的方法来访问外部配置,或者您是否认为我在项目中访问它的方式存在问题
浏览 13
提问于2019-06-05
得票数 0
1
回答
Spring
Cloud
Server
Config
只刷新application.yml,不刷新其他属性文件
、
、
、
我的
Spring
Boot
项目中有一堆YAML和属性文件:- application-dev.yml -
spring
-integration.properties我正在尝试理解如何为我的项目实现
Spring
Cloud
Server
Config
,并且我很难弄清楚为什么
Spring
Cloud
Server
Config
没有在我的任何其他文件(除了application.yml@SpringBo
浏览 4
提问于2018-08-17
得票数 0
2
回答
更改
Spring
外部化配置时的向后兼容性
、
、
、
例如,给定一个库在过去使用了通过@
ConfigurationProperties
定义的以下配置结构: an: another
浏览 6
提问于2020-12-18
得票数 5
回答已采纳
1
回答
Camunda对数据库创建脚本使用单独的用户
、
在我的Camunda
Spring
Boot
应用程序中,我使用application.properties设置数据库连接信息,即
spring
.datasource.url=<database url>
spring
.datasource.password=<password>
spring
.datasource.driverClassName
浏览 160
提问于2019-04-15
得票数 1
2
回答
客户端提供错误未能配置DataSource:“url”属性未指定
、
、
、
Spring
服务器以application.properties启动:
spring
.application.name=test-
config
-
server
spring
.cloud.
config
.
server
.git.uri=https://gitlab.com/pearsontechnology/gpt/sms/sms-micro-services&
浏览 10
提问于2022-11-28
得票数 0
1
回答
如何使用继承的
ConfigurationProperties
从yml文件中绑定属性值
、
@
ConfigurationProperties
(prefix = "store") public class MessageStoreConfig extends StoreConfig {} @Component @
ConfigurationProperties
(prefix = "
config</em
浏览 75
提问于2021-10-04
得票数 0
回答已采纳
1
回答
EntityManager类型的2个bean
、
、
、
、
我正试图在
Spring
应用程序中设置第二个数据源。; private String pw; private String driver; @Primary @
ConfigurationProperties
(&q
浏览 4
提问于2019-11-24
得票数 0
1
回答
如何用WebApplicationInitializer配置@EnableConfigurationProperties,@
ConfigurationProperties
?
、
、
、
我想用以下命令来阅读application.properties SpringApplication.run(Application.class, args);} public class ApplicationCon
浏览 2
提问于2015-04-09
得票数 2
1
回答
@ConfigurationProperites升级到
Spring
Cloud Hoxton.SR7后未绑定属性源
、
、
我有一个不再绑定到YML属性源的@
ConfigurationProperties
类,该属性源在升级到Hoxton.SR7后通过
Spring
Cloud
Config
进行解析。在最新的
Spring
Boot
2.2.9.RELEASE中使用Hoxton.SR4时,这段代码可以很好地工作。现在,我的属性没有绑定,当我尝试引用它们时,会收到NPE。@Bean return new MyPropertiesBean
浏览 27
提问于2020-08-05
得票数 1
10
回答
Kotlin &
Spring
@
ConfigurationProperties
、
、
如何在
ConfigurationProperties
Spring
Boot
中正确初始化Kotlin @
ConfigurationProperties
("app") var foo: String?
浏览 14
提问于2017-08-30
得票数 65
回答已采纳
2
回答
Springboot application.properties文件无法使用默认和自定义属性
、
、
我的应用程序属性类文件位于src/main/resources中,如下所示
spring
.
boot
.
config
.developerName= "f21ad267-e241-4ed0-8943-721fa90bcf3a"Access-Control-Allow-Origin: * 我构建的外部
Config
浏览 8
提问于2020-01-13
得票数 0
回答已采纳
1
回答
Spring
Cloud
Config
Client -相同前缀的聚合配置
、
我在
Spring
Boot
微服务应用程序中通过
Spring
Cloud
config
Server
加载了以下配置: { "list": [ "b": "b1" { "b": "b2"
浏览 29
提问于2020-04-14
得票数 0
1
回答
@RefreshScope不使用外部配置文件
、
、
我在我的pom中添加了以下依赖项,以便可以使用
Spring
cloud <dependency> <artifactId>
spring
-
boot
-starter-actuator</artifactId> <dependency>作为Finc
浏览 27
提问于2020-01-30
得票数 1
2
回答
Spring
配置datasource失败:未指定“url”属性,也无法配置任何嵌入式数据源
、
、
server
.os=LINUX dl.writeTOConsole=true<dependency><groupId>org.springframework.
boot
</groupId> <artifactId>
spring
-
boot
-starter</artifactId><groupId>org.springframework.<e
浏览 3
提问于2020-12-07
得票数 5
回答已采纳
1
回答
在
spring
Boot
中使用
Spring
profiles读取多个属性文件
、
、
、
我正尝试在
spring
boot
中加载2个属性文件。其中一个包含元数据(数据库连接和其他类似属性)。另一个包含业务逻辑(上下游实体之间的映射。我想在不同的环境(Dev,Stage,Prod)中使用
Spring
Profiles。因此,我在src/main/resources 1中为每个环境创建了3个不同的文件夹。使用
spring
profies,我知道如何使用env特定的应用程序-env.properties文件。然而,我无法在我的用例中使用相同的方法。 PS :不添加任何代码片段,因为问题不需要代码片
浏览 9
提问于2021-10-07
得票数 0
1
回答
Spring
@ConfiurationProperties扩展Mao的问题
、
、
、
我正在尝试使用
Spring
@
ConfigurationProperties
和@
ConfigurationProperties
组合从配置中加载come属性。@Configurationpublic class MyConfigPojo extends HashMapdefaultValue; private String getValueForIdOrDefault(int id); /
浏览 14
提问于2020-09-02
得票数 0
5
回答
Spring
Cloud
Config
Server
上的属性不会注入
Spring
应用程序
、
我正在自学
Spring
Cloud
Config
Server
,在将属性注入bean时遇到了一些麻烦。所以我有一个简单的
Spring
Boot
应用程序作为配置客户端,只是为了测试:@
ConfigurationProperties
import org.springframework.
b
浏览 3
提问于2016-04-09
得票数 2
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
云点播
对象存储
即时通信 IM
活动推荐
运营活动
广告
关闭
领券