Questions tagged [spring-profiles]

Spring Profiles provide a way to segregate parts of an application configuration and make it only available in certain environments.

Spring Profiles provide a way to segregate parts of an application configuration and make it only available in certain environments.

http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-profiles.html

349 questions
0
votes
1 answer

Load spring xml configuration according the profile

I know that I can load application context from xml file like this: ApplicationContext app = new ClassPathXmlApplicationContext("META-INF/applicationContext.xml"); But in my case it is irrelevent. inside the applicationContext.xml I use…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
0
votes
1 answer

Spring profiles: Repository bean cannot be autowired

I'm having issues when trying to run a JUnit Test with some Spring profile I've created. Actually, profiles do work fine, except for a repository bean, which cannot be autowired. This is the fragment of code I use to configure persistence in…
user2957378
  • 627
  • 2
  • 14
  • 29
0
votes
1 answer

spring profile activation with some beans having no profile

I have a spring file config1.xml that has beans with no explicitly defined profile. I also have another file config2.xml with two bean profiles (profileA and profileB). If I import the latter one into the former and activate profileA at runtime,…
ishan3243
  • 1,870
  • 4
  • 30
  • 49
0
votes
1 answer

Unable to wire using ActiveProfile annotation

First time using Profiles and need help. I have an abstract base class (DecisionManagementRuleExecutor) that gets its dependency (RuleHandler) wired through annotation. @Component public class RuleHandler {...... public abstract class…
patb23
  • 387
  • 5
  • 21
0
votes
1 answer

Setting spring.profiles.active from Spring PropertyPlace holder

In Spring 3.2 by default, Spring Environment object will resolve spring.profiles.active OS environment or -D JVM switch. I have a use case where I need to set the active profile from a common properties file. However, I am unable to make Environment…
Hector
  • 11
  • 3
0
votes
1 answer

Spring Environment profiles and server properties

I have a requirement to load properties for different environments like DEV, QA and I have different properties file for each environment. So I solved this by setting environment property in server and accessing this value to load respective…
Skanda
  • 835
  • 1
  • 15
  • 32
0
votes
2 answers

Spring Environment Profiles & JPA

I want to implement environment profiles in my Spring JSON API application to handle multiple environments, development, testing, production. I've seen examples such as Unable to use JNDI DataSource provided by Tomcat in Spring?. I really only need…
greyfox
  • 6,426
  • 23
  • 68
  • 114
0
votes
1 answer

Troubleshooting spring profiles at runtime

I'm currently maintaining a legacy codebase where the following Spring profile configuration has been specified in the application context: spring.profiles.active=addressbook-[usermanager|webservices],entrypoint-[form|saml] The question is: how do…
Jesús Zazueta
  • 1,160
  • 1
  • 17
  • 32
0
votes
1 answer

Issue with spring profile not being picked properties value from server env?

I have configured spring.profiles.active environment variable into websphere server and using variable value into spring config file. My Config.xml is like
pankaj
  • 587
  • 1
  • 7
  • 19
0
votes
2 answers

Spring profiles - risky code in svn

We are developing a project with spring framework. we are using a tomcat cluster and in order to do some really advanced integration tests we added some controllers to the web app that are allowing some risky stuff that must not reach the…
Urbanleg
  • 6,252
  • 16
  • 76
  • 139
0
votes
3 answers

Spring Java Configuration and property placeholder resolution

I'm trying to wrap my head around how Spring resolves property placeholders when not explicitly declaring a PropertySourcesPlaceholderConfigurer bean. Looking through the source of an existing project that configures spring through java via…
Perrin
  • 68
  • 1
  • 7
0
votes
2 answers

Spring Profile conditional prop files multiple environment

I have a question, with Spring Profiles. I understand the reason for not using maven profiles because each environment would require another artifact. That makes since. I modified my code to use Spring Profile but the problem I have with Spring…
Trevor
  • 363
  • 7
  • 20
0
votes
1 answer

Loading util:properties with Spring Profile causes multiple occurrences of ID

I am using Spring(3.1) profiles to load property files vis util:properties:
enkor
  • 7,527
  • 3
  • 31
  • 55
0
votes
1 answer

how to add active profile to spring in conjuction with spring's spring.profiles.active

We do have some spring profiles enables via web.xml spring.profiles.active and I want to leave it that way as this is the way for our deployment team to activate profiles. in addition I want to activate some more profiles based on the presence of…
Shalom938
  • 909
  • 2
  • 10
  • 24
0
votes
0 answers

Spring profile, code based config and JNDI

I am moving to new Spring 3.x code based @Configuration style. I have done good, so far, but when I tried to add a @Profile("production") to select a JNDI data source instead of C3p0 connection pool @Profile("standalone"), I've got: Error creating…
1 2 3
23
24