2

I have the following code in my config xml file:

<jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="urn:jboss:jbosscache-core:config:3.2">
    <locking isolationLevel="READ_COMMITTED" nodeLockingScheme="mvcc"
        useLockStriping="false" concurrencyLevel="1500"
        lockParentForChildInsertRemove="false" lockAcquisitionTimeout="10000"
        writeSkewCheck="true" />
    <!-- 0 = no eviction -->
    <eviction wakeUpInterval="500" />

    <loaders passivation="false" shared="false">
        <preload>
            <node fqn="/" />
        </preload>
        <loader class="org.jboss.cache.loader.FileCacheLoader" async="false"
            fetchPersistentState="true">
            <properties>
                location=/${env.VG_HOME}/cacheloader
            </properties>
        </loader>
    </loaders>

</jbosscache>

where VG_HOME is an env var which points to a local folder.

I have tested this setup on Linux and Windows using a Jetty server and it worked as expected.

Under tomcat 7, I created the setenv.sh/bat with set "VG_HOME=C:\config". However, when starting the app, the cacheloader folder is created under the root (both windows/linux), with the following name ${env.VG_HOME}. I suspect that the location property in the xml does not see the env set in the setenv.sh/bat file.

Any ideas on a fix, meaning the app creates the folder under the right location when using Tomcat.

Thanks!

  • Take a look at this [post](http://stackoverflow.com/questions/13066042/how-to-give-environmental-variable-path-for-file-appender-in-configuration-file) – Maraboc Nov 02 '15 at 10:50

1 Answers1

1

After digging in @Maraboc answer, I found the right place to fix it. go to your setenv file and add the following:

set CATALINA_OPTS="-Denv.VG_HOME=%VG_HOME%"

if you are using TC6, it will not work, you will need to add it to catalina.bat file below the remarks.

soninob
  • 428
  • 11
  • 22