I have a WAR that I've set as the default web app in Tomcat's server.xml:
Inside Server.xml
<Host...>
<Context docBase="mywar" path="" />
In addition, I have a META-INF/context.xml
file where I set an environment variable.
<?xml version="1.0" encoding="utf-8"?>
<Context debug="0" reloadable="true">
<Environment
name="my.name"
type="java.lang.String"
value="donrhummy"
/>
</Context>
But it's throwing an exception javax.naming.NameNotFoundException: Name my.name is not bound in this Context
.
How can I get that context variable in my app?
NOTE: That variable exists when I go to http://localhost/mywar