tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anu Gali <>
Subject Adding reference to properties file in Tomcat context.xml or server.xml
Date Thu, 28 Jul 2011 00:08:48 GMT
        I am trying to externalize a properties file outside of the app war in the
tomcat context itself.This is so that the war can be build and ported to different env without
having to change the properties file in each env every time.

Lets say that the properties file is called:
1) I placed all the properties, in tomcat_home/conf/context.xml and/or
 tomcat_home/conf/Catalina/localhost/context.xml. Eg.,
<Context path=/app>
<Parameter  name="maxExemptions" value="10" override="false"/>

 When I start tomcat, I get the following error:
Jul 27, 2011 4:38:38 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor context.xml
Jul 27, 2011 4:38:38 PM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 45 column 43: Element type "Parameter" must be followed
by either attribute 
specifications, ">" or "/>".
org.xml.sax.SAXParseException: Element type "Parameter" must be followed by either attribute
specifications, "
>" or "/>".

2) Also tried using <Environment name="maxExemptions" value="10"
         type="java.lang.Integer" override="false"/>, get the similar exception
as before.

Is it possible to just provide the properties file path in server.xml or context.xml, so that
tomcat would load it on startup? I have done this in JBoss using the  properties-service.xml
file giving it the path to properties file which gets loaded on startup and the app can just
reference those variables.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message