Recently I had a requirement where I had to add a directory into the watched directory chain in virgo tomcat server (VTS 3.0.3). Requirement was to check if some jars are present in a particular directory, and if jars are present then add the directory programmatically (using shell script) in the watched directory chain.
So, I created a shell script which looks like below:
I compared the changes with other watched directories but could not find any clue.
Then after struggling a lot I realized that there is a extra space after the value of property "external_jars.type". And as soon as I removed the extra space, it worked.
Corrected script is:
Just thought of sharing this info, so I blogged it.
So, I created a shell script which looks like below:
When I ran the script it worked all fine, and the configuration file also got updated, but when I restarted my virgo server it did not pick my "external_jars" directory into the chain of watched directory.if [ -f /usr/local/vts/external_jars/util* ] ; thenecho "Found the util jar under /usr/local/vts/external_jars"sed -i '/usr.watchDirectory=repository\/usr/ a\external_jars.type=watched \external_jars.watchDirectory=external_jars' $VTS_HOME/config/org.eclipse.virgo.repository.propertiessed -i "s/usr,/usr,external_jars,/" $VTS_HOME/config/org.eclipse.virgo.repository.propertiesfi
I compared the changes with other watched directories but could not find any clue.
Then after struggling a lot I realized that there is a extra space after the value of property "external_jars.type". And as soon as I removed the extra space, it worked.
Corrected script is:
if [ -f /usr/local/vts/external_jars/util* ] ; thenecho "Found the util jar under /usr/local/vts/external_jars"sed -i '/usr.watchDirectory=repository\/usr/ a\external_jars.type=watched\external_jars.watchDirectory=external_jars' $VTS_HOME/config/org.eclipse.virgo.repository.propertiessed -i "s/usr,/usr,external_jars,/" $VTS_HOME/config/org.eclipse.virgo.repository.propertiesfi
Just thought of sharing this info, so I blogged it.