Linked Questions

52 votes
5 answers
104k views

Using a construct such as @Component public class SomeClass { @Inject private Environment env; private String key; @PostConstruct private void init() { key = env....
Abdull's user avatar
  • 28.2k
6 votes
3 answers
14k views

In a Spring file I have: <bean id="propertyConfigurer" class="org.myapp.MyConfigurator"> <property name="locations"> <list> <value>...
Randomize's user avatar
  • 9,153
7 votes
3 answers
11k views

This is the code to get the present working directory of a java application at runtime. String currentWorkingDirectory = System.getProperty("user.dir")+System.getProperty("file.separator"); Is ...
Saikat's user avatar
  • 568
3 votes
3 answers
26k views

I have a class that simply returns environment variables with System.getEnv, and I'm trying to write a JUnit test for it, but I always get just null. I'm trying to use an application-test.yml with all ...
Giacomo Giovannini's user avatar
6 votes
1 answer
14k views

I have a huge sqlite file containing my db. I need to know if it is possible and how to connect to this db as an embedded one with jpa. I'm developing an app that packs this database inside it's own ...
Luca Federzoni's user avatar
1 vote
2 answers
7k views

I am trying to load a property file from an environment variable, so here's what I tried: <bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config....
fresh_dev's user avatar
  • 6,784
2 votes
1 answer
9k views

This is my class : ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("beans.xml"); PropertyPlaceholderConfigurer pph = new PropertyPlaceholderConfigurer(); pph.setLocations(...
sharma sharma's user avatar
2 votes
1 answer
7k views

It seems to be easy, but it does not work. I can't paste system property in my easy example: <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <...
IvanSPb's user avatar
  • 303
1 vote
2 answers
5k views

I want to use my system environment variables (i.e use variable FOO that I have defined in my .bash_profile export FOO=BAR) for values in Spring's applicationContext.xml; For example: <bean id="...
Glide's user avatar
  • 21.4k
1 vote
4 answers
3k views

I have this application.properties: url.up=${url:http://localhost:8080/upload} And I want to extract the url "http://localhost:8080/upload". How can I extract it? I tried something like ...
username1234565432's user avatar
2 votes
2 answers
4k views

I am attempting to externalize the configurations using spring, but cannot get it to work properly.. Here is what I did so far: create a property file inside the war file (src/test/resources/) for ...
SGB's user avatar
  • 2,260
1 vote
1 answer
4k views

I am using mybatis to connect to database and i have stored some schema information in external properties file. I have kept this property file somewhere on my disk and referring it in my config.xml ...
Gani's user avatar
  • 709
0 votes
1 answer
2k views

I'd like to allow my Spring 3.1.2 application to load configuration properties from a default properties file embedded within my jar and additionally allow the user to specify the path to an ...
jeremy303's user avatar
  • 9,271
0 votes
2 answers
2k views

Hello I am new to Spring so please forgive me if its a silly question. I need to load a properties file from a path specified in the environment variables, For example, my environment variable will ...
Abhishek Amte's user avatar
1 vote
2 answers
802 views

I am new to openshift. I created a sample application with spring security and tried to deploy in it. My spring-database.xml fragment looks like below. <bean id="dataSource" class="org....
karthik's user avatar
  • 473

15 30 50 per page