-
1. Re: How to set System Properties file in Jboss 7.1 ?
ctomc Jun 15, 2012 6:05 AM (in response to rajeshkumarp)Hi,
What exact version you are using, as this has changed a bit in 7.1.x versions.
and what kind of operation mode are you using? Domain or Standalone?
--
tomaz
-
2. Re: How to set System Properties file in Jboss 7.1 ?
rajeshkumarp Jun 15, 2012 6:13 AM (in response to ctomc)Jboss 7.1.1 Final
I am using both Domain and Standalone.
Thanks for the quick reply Tomaz
-
3. Re: How to set System Properties file in Jboss 7.1 ?
poz Jun 15, 2012 11:26 AM (in response to rajeshkumarp)You can add, after the <extensions> node, a block like
<system-properties>
<property name="propertyName" value="propertyValue"/>
</system-properties>
Regards
-
4. Re: How to set System Properties file in Jboss 7.1 ?
rajeshkumarp Jun 15, 2012 11:46 PM (in response to poz)Hi Poz,
What you said is 1 of the System Property in the System Properties file.
But I need to set the "System Properties File" as User defined one.
-
5. Re: How to set System Properties file in Jboss 7.1 ?
sfcoy Jun 16, 2012 1:23 AM (in response to rajeshkumarp)1 of 1 people found this helpfulThere's a couple of different ways to do this.
The easiest is to use the "-P" option on the command line:
{code}# bin/standalone.sh -P path/to/my/system.properties{code}
Alternatively, you can follow the instructions on How to put an external file in the classpath and then load it from an @Startup bean:
{code:java}@Singleton
@Startup
public class SystemPropertiesLoader{
@PostConstruct
void initialise() {
Properties mySystemProperties = new Properties();
mySystemProperties.load(SystemPropertiesLoader.class.getClassLoader().getResourceAsStream("settings.properties"));
System.getProperties().putAll(mySystemProperties);
}
}{code}
Caveat: the code above has been entered "off the cuff", but should get you going.
Also, please don't use this for new code. Only use it if you're porting existing stuff as there are better ways to do this.
-
6. Re: How to set System Properties file in Jboss 7.1 ?
rajeshkumarp Jun 16, 2012 2:08 AM (in response to sfcoy)Thanks for your response Stephen.
The Second alternative you mentioned is the workaround I have already chosed.
Of Course you are right that , I am porting existing stuff and there is my problem.
Just curious to know whether we can specify the System Properties file manually.
-
7. Re: How to set System Properties file in Jboss 7.1 ?
madhu.garimilla Jan 17, 2014 2:40 AM (in response to sfcoy)Hi Stephen, Could you please add some details on the other better ways you were referring to. I am using EAP 6.1 alpha and i have similar requirement.