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
0
votes
0 answers

Spring @ContextConfiguration Enforce order?

I have written some Configuration classes in Spring (4.1.7) to make writing some standard stuff (e.g. Testcases) easier. For this, I used @Condition to check, for example, if there already is a DataSource defined, if not, create a new in-memory one.…
Florian Schaetz
  • 10,454
  • 5
  • 32
  • 58
0
votes
1 answer

Spring MVC Will Not Map to My Controller

I am trying to migrate a project from a traditional (working) Java servlet application to Spring MVC in the NetBeans IDE, but my program absolutely refuses to ping the Controller. On the client side, I see the following 404…
Negimaki
  • 17
  • 6
0
votes
1 answer

Spring Config: It's not able to locate Config server

Config Server bootstrap.yml: spring: application: name: configserver profiles: active: vault cloud: config: server: vault: host: ${vault_server_host:localhost} port: ${vault_server_port:8200} …
user10063942
  • 101
  • 3
  • 9
0
votes
0 answers

Spring config: Nested env variable into SPRING_APPLICATION_JSON

Could I nest additional env variables into environment variable SPRING_APPLICATION_JSON? Example: SPRING_APPLICATION_JSON='{"spring": {"datasource": { "url":"$ENV_URL", "username":"$ENV_USER", "password":"$ENV_PASSWD" } } }' Is it going to work…
Jordi
  • 20,868
  • 39
  • 149
  • 333
0
votes
2 answers

Spring mvc controller doesn't work

I have simple Spring MVC project and as I see Controller doesn't work After running page http://localhost:8080/story/list shows HTTP Status 404 - But when I'm running TestDbServlet all works fine (mapped http://localhost:8080/TestDbServlet) Project…
0
votes
0 answers

Spring config server throwing error while fetching properties file from remote GIT repo but works fine with local GIT repo

I have created a Spring Config Server using spring cloud to fetch properties file from remote GIT repo. But when I hit http://localhost:8081/spring-config/eureka it gives the below error on console - (i have created a file with name…
0
votes
1 answer

Custom Auto Configuration in Spring Boot cannot find DataSource with ConditionalOnBean

I have a problem with Spring Boot version 2.0.1.RELEASE (in Spring Boot 2.0.0.RELEASE the below configuration worked nice). Could somebody help me out please why this configuration is not working? I have this configuration and this config did not…
0
votes
1 answer

Custom Key generator not being used by default in Spring Boot

I have a custom key generator and it only gets called if I use the "keyGenerator" property in the @Cachehable annotation. My configuration class that creates it is pulled in as a gradle dependency (and is loaded and my key generator is…
Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
0
votes
1 answer

Failed to process import candidates for configuration class in Spring Configuration Server when running with Spring boot

I am new to Spring and trying to have a Spring Cloud configuration server, But when i am trying to start server , i am getting below error :- org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for…
priyam singh
  • 105
  • 3
  • 16
0
votes
1 answer

Trying ot understand use of @RunWith(SpringJUnit4ClassRunner.class) and @ContextConfiguration(locations= {/dao-context.xml})

I am new to Spring and Junit testing. I am trying to understand use of @RunWith(SpringJUnit4ClassRunner.class) and @ContextConfiguration(locations= {/dao-context.xml}) on line 1 and line 2nd below in my test. dao-context has datasource ,…
Neha
  • 745
  • 4
  • 10
  • 18
0
votes
1 answer

create multiple json object and pass in spring controller through ajax