0

I have a jar which is placed in the lib/ext within the tomcat directory. It needs to load an config file external to the jar. Which directory would be the most appropriate? Is it a good practice to place the properties file within the lib/ext folder, .i.e, the same folder as the location of the jar. Or would this be more apt to be place it in the conf folder within the tomcat directory assuming that the relative path from lib/ext to conf would remain the same?

user592748
  • 1,194
  • 3
  • 21
  • 45
  • The details about the jar you are using will help in answering. is the jar an extension or plugin for tomcat ? If no, then place that with the application which requires it. For Example, log4j jars are kept with the app which uses and the properties file is kept in the application itself. – bgth Apr 14 '14 at 19:10
  • I want a config file specific to each server. Right now it takes the config file from the jar. Instead, I want it to load an external config file. Hence, my question is where would be an appropriate place to put it within the tomcat directory structure. – user592748 Apr 15 '14 at 06:27
  • 1
    this will be of help. http://stackoverflow.com/questions/1380793/configure-tomcat-to-use-properties-file-to-load-db-connection-information http://stackoverflow.com/questions/13956651/externalizing-tomcat-webapp-config-from-war-file . You can use the conf folder of the tomcat because you want prop for specific server instance. – bgth Apr 15 '14 at 06:54

0 Answers0