is it possible to access Wildfly properties (defined in standalone.xml) through JNDI? Like:
<system-properties>
<property name="MY_PROPERTY" value="some value"/>
...
</system-properties>
and read it in java:
@Resource(lookup = "java:comp/env/MY_PROPERTY")
private String property;
<system-properties>
are used to define environment variables and not JNDI variables. Define JNDI variables inside
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<bindings>
...
<simple name="java:/env/MY_PROPERTY" value="some value"/>
</bindings>
</subsystem>
Now, you can read it as a JNDI.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With