-
1. Re: Externalising bits of persistence.xml
smarlow Dec 18, 2012 10:06 PM (in response to tony.herstell1)As mentioned here, you need to configure the following in standalone.xml (or whatever your AS configuration file is that your using):
<spec-descriptor-property-replacement>true</spec-descriptor-property-replacement>
<jboss-descriptor-property-replacement>true</jboss-descriptor-property-replacement>
Note that you can use the system property replacement for the property values but not the property names.
Scott
-
2. Re: Externalising bits of persistence.xml
tony.herstell1 Dec 19, 2012 12:16 AM (in response to smarlow)Thanks Scott.
From what I have read I can't use it as am using JBoss 7.1.1.Final
>>> I am replying to my question here, which was answered in another issue https://community.jboss.org/message/761464#761464 . It is not available in 7.1.1
I will just have to ship 2x War files and they can run one until it works (with create-drop and a 2MB import.sql!) and then run the one with Validate (or update if I feel lucky ).
Is it possible to pass in a "command line param" (i.e. from the command line when running the server):
xxx -system-param bling=123
and then access if via summat like:
$$bling$$
?
-
3. Re: Externalising bits of persistence.xml
nickarls Dec 19, 2012 2:10 AM (in response to tony.herstell1)If you pass in -Dfoo=bar, ${foo} should be evaluated to bar in all config files that support replacement. You can also dig out the value in your own code with System.getProperty("foo");
-
4. Re: Externalising bits of persistence.xml
tony.herstell1 Dec 19, 2012 6:48 PM (in response to nickarls)>> config files that support replacement
I am struglling to find any doco on this (like what supports replacement)?
useful for thing slike setting up the annottions too:
e.g.
@Schedule(minute = "*/2", hour = "*", persistent = false) // every 2 mins
@Schedule(minute = "*/$$schedule_for_xxx_minute$$", hour = "$$schedule_for_xxx_hour$$", persistent = false) // offline configurable
-
5. Re: Externalising bits of persistence.xml
nickarls Dec 20, 2012 2:48 AM (in response to tony.herstell1)Annotations are compile-time constructs but timers can also be defined in xml so the ${delay_minute} could be placed there if it's supported.
There are some details in http://www.scribd.com/doc/104045906/Jboss-EAP-6-Administration-and-Configuration-Guide-en-US#outer_page_212 for enabling the features on 7.1.2
Annotation based replacement would have to involve some sort of maven pre-processing of Java files. Doable but not nice.
-
6. Re: Externalising bits of persistence.xml
tony.herstell1 Dec 20, 2012 2:10 PM (in response to nickarls)Nicklas,
Thanks for the reply and I will be reading up on the linlk you sent.
Even though I use Maven for dependencies I still don't use a build script so any pre-processing of Java files would not be workable as it would slow developent too much.