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
1 answer

How to use injection with XmlMapper deserialization

I am using XmlMapper from com.fasterxml.jackson.dataformat.xml. The class, I am serializing, has an Autowired member that is not serialized. I want to be able to deserialize the XML into an instance and have the autowired member variable populated…
KenB
  • 215
  • 1
  • 5
  • 17
1
vote
2 answers

How to change spring bean property value in xml at runtime?

I have a springconfig.xml file and i used to get the bean property values from my.properties file. property file values are changed dynamically. but it will not set to the spring bean property. it will change only after i restart my tomcat. Here is…
Sathish vp
  • 72
  • 12
1
vote
1 answer

Spring boot controlling start up of application

How can I control programmatically start up of app depending of config server? I have sh script for controlling on docker-compose up, but I’m wondering can I control it programly in the spring app. Regards
sherybedrock
  • 63
  • 10
1
vote
1 answer

Spring cloud server returning empty configurations

I have a dead simple config server with following properties : spring: profiles: active: native cloud: config: server: native: searchLocations: classpath:/configs server: …
Martin
  • 1,977
  • 5
  • 30
  • 67
1
vote
1 answer

Failed to use repositories and services having 2 spring contexts

I have 1 spring context named PersistenceJPAConfig. Now I want to configure a spring batch and for that I have added a new class with @Configuration annotation and @EnableBatchProcessing. After adding new configuration class, I got error trying to…
1
vote
2 answers

Spring Cloud Config without the server

The role of the Config Server while using Spring Cloud Config seems to be pretty dumb and hosting it seems to be an unnecessary overhead. Is there a way to get the Clients to directly read configs from the git repo?
1
vote
1 answer

How to refresh config clients automatically?

I am new to Spring Config Server/Client technologies. I am using a spring config server to hold some config values. Config clients will connect to the server and get the values. If i change some of the config values at the config server, then…
Rahul Vedpathak
  • 1,346
  • 3
  • 16
  • 30
1
vote
1 answer

Spring boot - init dataSources before anything else

I have 2 configuration class one with datasources configuration and the other is my WebSecurityConfig that extends WebSecurityConfigurerAdapter. I want to load DB values to be used in WebSecurityConfig, so I need to finish initing the datasources…
Itsik Mauyhas
  • 3,824
  • 14
  • 69
  • 114
1
vote
1 answer

Run spring boot jar file with profiles - error can't find properties files

I am facing problem in running a spring boot jar file with external profile. I have a spring boot project with jersey. I have placed the properties and some certificate file in different directories (for different servers development and production…
1
vote
1 answer

How to inject a string that contains ${...} in spring application.properites

How to inject a string that contains ${...} in spring application.properites I wanted to provide following key value pair in the applicaiton.properties file in spring and wanted spring to ignore the place holder without resolving…
mac
  • 543
  • 1
  • 6
  • 17
1
vote
1 answer

Connection to one from two Identical databases in Spring boot application at RUNTIME

UPDATED I'm getting an issue with Spring framework while I try to connect to 2 identical databases (with same tables) and then choose one of them to make requests. I'm using for this, 3 config files DbConfig, AbstractRoutingDataSource and an…
1
vote
1 answer

Multi-tenancy Dynamic switch between Datasources is not working

I am trying to implement multi-tenancy in my spring boot application. I am referring "http://anakiou.blogspot.com/2015/08/multi-tenant-application-with-spring.html" example. In this example everything is working fine. but in my code Switching…
Pavan
  • 153
  • 3
  • 13
1
vote
0 answers

Running Spring boot locally with a MySQL container as dependency?

After some radical changes to our schema and reading some posts on why you should avoid in memory databases. We have decided to use MySQL locally for testing and developing. Using a MySQL docker container with a volume for persistence. This is…
tomaytotomato
  • 3,788
  • 16
  • 64
  • 119
1
vote
1 answer

Spring MVC Dispatcher unable to find controller handler method

I have the weirdest error ever. In my logs it validates I have created a mapping for "TrainingRequest" 018-10-23 21:58:43,900 [main] [INFO ] o.s.w.s.m.m.a.RequestMappingHandlerMapping - Mapped "{[/TrainingRequest],methods=[GET]}" But when I try to…
Rahmi Pruitt
  • 569
  • 1
  • 8
  • 28
1
vote
1 answer

Context Level in Spring Web Application Architecture

I am struggling with Architecture level of Spring web application, Below I am making my pointers. Please help regarding the below: Context Level Programing: Servlet Context and Root Application Webapplication context and Web Application context. I…
Yawar
  • 11
  • 5