-
Feb 19th, 2008, 04:32 AM
#1
Setting System Property via spring
Hi All,
I want to set system property in my application via spring config file. I tried to set system property as below but I couldn't be successful.
<bean id="Test" class="java.lang.System" factory-method="setProperty">
<constructor-arg value="propname"/>
<constructor-arg value="propvalue"/>
</bean>
Error creating bean with name 'Test' defined in class path resource [config.xml]: Factory method 'setProperty' on class [java.lang.System] returned null.
Can anybody pls let me know how can I handle null bean in a context or any other way to set the system property via config file ( other part can not be changed ).
Although it's not a efficient of doing it, I have no other option.
thnx
cravi
Last edited by cravi; Feb 19th, 2008 at 08:43 AM.
-
Feb 22nd, 2008, 12:39 AM
#2
If you really need to do something like this create your own Java class where you do the actual operation. You can instantiate your Java class as usual in the context.
Joerg
-
Feb 22nd, 2008, 04:26 AM
#3
thnx Joerg for response,
But I have got so many users of this application,it is really very difficult for me to add anything there. The only thing which I can change is my spring config file.
That's why I am searching anything in spring which can set my system variable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules