Wildfly variable properties -


standalone.bat

set "dbo_path=d:\test" 

standalone.xml

<subsystem xmlns="urn:jboss:domain:naming:2.0">     <bindings>         <simple name="java:propertiesfilename" value="${dbo_path}/test.properties"/>     </bindings>     <remote-naming/> </subsystem> 

how set properties wildfly picks them ??

how use relative path in value standalone.xml

you there. in order achieve goal, need following:

  1. set environment variable set "foo=bar"

  2. then change standalone.xml contain reference ${env.foo}: <simple name="java:/foo" value="${env.foo}/test.properties"/>.

  3. you can check if solution working running following java ee 6+ code

    @singleton @startup public class startupbean {      @resource(lookup="java:/foo")     string foo;      @postconstruct     public void start() {         system.out.println("java:/foo = " + foo);     } } 

please refer http://www.mastertheboss.com/jboss-server/jboss-configuration/how-to-use-environment-variables-in-standalone-xml-or-host-xml possible solution.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -