Properties placeholders substitution on configuration file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Properties placeholders substitution on configuration file

robertop
This post has NOT been accepted by the mailing list yet.
Hi,
I have defined some properties in custom.properties file, for example:

datasource.portno=5432

and in the configuration file of my bundle I used a placeholder to retrieve the already defined property:

portNumber=${datasource.portno}

but on bundle start the placeholder seems to be not substituted correctly and I receive the error:

2017-08-30T16:03:08,992 | ERROR | features-1-thread-1 | Felix                            |  -  -  | Bundle org.ops4j.pax.jdbc.config [120] EventDispatcher: Error during dispatch. (java.lang.NumberFormatException: For input string: "")
java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]

I'm using Karaf Container 4.1.2.

What is the correct way to use properties in configuration files?

Thank you in advance
Best regards
Roberto