Questions tagged [spring-config]

Refers to the org.springframework.context.annotation package of the Spring Framework that moves bean definition and Spring configuration out of XML file and into Java classes via annotations.

Questions referring to @Configuration and @Bean will be the primary source of questions for this tag.

Useful Links

178 questions
1
vote
2 answers

How can I manually add a Spring CacheInterceptor using Java Config?

I'm trying to work out how I can add caching to method calls on a third party Java class. I'm using Spring Boot for my application. I've come up with this class in my attempts to get caching working. package test; import…
Programming Guy
  • 7,259
  • 11
  • 50
  • 59
1
vote
1 answer

How to configure multi-module projects in Spring without repeating yml config file props?

I have three projects. Proj 3 depends on Proj 2 and Proj 2 depends on Proj 1. Each project uses Spring Boot and is configured with yml files. I don't want to repeat the yml configuration of Proj 1 in Proj 2. Likewise, I don't want to repeat the in…
James
  • 2,876
  • 18
  • 72
  • 116
1
vote
0 answers

Spring Boot config Client | Rest End Point not working

I was trying to externalize the configurations through spring boot config server. I am using SVN as version control for configurations. https://svnret2.uk.fid-intl.com:18081/svn/Test_Config/trunk/dev/myapp/myapp-dev.properties Config server is up…
Bhoomi23
  • 11
  • 1
1
vote
1 answer

Why are spring beans validated even if the condition says it should not be loaded into the context?

Given the example below, I would expect MyConfig.getSrvConfig() would not be called and therefore no validation would be executed on the returned object neither. But for some reason the validation is executed and the test case fails. Is there…
domi
  • 2,167
  • 1
  • 28
  • 45
1
vote
0 answers

Spring EJB - WEB - ELASTICSEARCH - JPA - CRUD - BUSINESS METHOD Linkage error

I'm in trouble and I'm stuck in developing my project. I started to develop a hobby project that is based on spring framework, and after a while the pieces of the project were beginning to fit together. There are two main modules, one is the EJB…
1
vote
1 answer

schema not works when no internet connection

schema works fine during internet connection but it shows me following warning message when internet connection is off No grammar constraints (DTD or XML Schema) referenced in the document. i have used following schemas in…
User5678
  • 191
  • 1
  • 8
1
vote
2 answers

how to read property file value in spring at runtime from input string

I am using Java+Spring+spring XML configuration in my project. I would like to read one property value from the property file and set java value in spring configuration using input String value. MyClass.class private String tableDetails; private…
Tokendra Kumar Sahu
  • 3,524
  • 11
  • 28
  • 29
0
votes
0 answers

Letting Spring Boot manage the lifetime of my objects

I am new to Spring Boot and still trying to grasp best practices. What attracted me was Spring Cloud Configuration. Initially I wanted to do a hybrid implementation (due to the size of the existing code base) of Spring Boot but it inevitably lead me…
user0000001
  • 2,092
  • 2
  • 20
  • 48
0
votes
1 answer

Spring config server with vault token doesnt respect the acl defined in vault

I have spring config server and vault as backend. i created a token in vault with an acl policy . when i use the token in spring.cloud.config.token it doesnt respect the acl My sping config client has this boot strap properties spring: …
0
votes
1 answer

Configuring Springboot Cloud Config Server - management.security.enabled=false flag Not Working

I am trying to implement a Spring boot cloud config server. My application.properties file: #Server port server.port=8888 #Git repo location. spring.cloud.config.server.git.uri=/home/pawan/git/config-server-repo #Disable security of the Management…
Pawan
  • 1,183
  • 16
  • 29
0
votes
2 answers

Accessing shared configuration object using Spring

I am new to Spring and not sure if there is a simple approach to what I am trying to do. Before I migrated some existing code base to Spring, I was manually loading configuration properties in a singleton class called ConfigurationProvider - pretty…
user0000001
  • 2,092
  • 2
  • 20
  • 48
0
votes
1 answer

spring-cloud-config what should contain file

I starting to work with spring cloud. I use spring-cloud-gateway, spring-cloud-config, eureka For my spring-cloud server, in application.properties server.port=8888 spring.security.user.name=admin spring.security.user.password=123 #for file…
robert trudel
  • 5,283
  • 17
  • 72
  • 124
0
votes
1 answer

What is the purpose of context in tag?

What is the purpose of "context" in tag in Spring? Why it's not just . What type of tag is this?
0
votes
0 answers

how to reload configuration object at runtime in spring mvc

i have a configuration class FTPSchedullingConfiguration which is initialise at app instantiation and get data from table for Starting a scheduler on given Scheduling Expression. And also my question are not Duplicate as Reloading/Refreshing Spring…
programmer420
  • 47
  • 1
  • 11
0
votes
0 answers

AbstractMethodError thrown by AutoConfigureStubRunner

I am using Spring Cloud Contract to test messaging contracts within our system. I have created the contract on the producer side, generated the stubs, and validated that the generated test passes as I expect. However, when I try to set up the…
mgzwarrior
  • 53
  • 1
  • 6