I’m configuring a servlet application on tomcat 6. The application needs to access a datasource. Hence, I defined a datasource in the META_INF/context.xml file in the standard war format. This worked fine on other platforms I used in the past besides suse. (Mandriva, Fedora, Tomdat 5.5.)
However, it seems that in my current setup (Suse 11.1, tomcat 6.0.18) tomcat does not pick up the resources i defined in the META_INF/context.xml: i get a naming exception.
I can move the resource definition to the global context.xml in $CATALINA_HOME/conf/context.xml. Then all works well, but that’s not elegant because i want only application scope. Alternatively, i can define the resource in $CATALINA_HOME/conf/Catalina/localhost/<MyAppName>.xml . That works fine as well, and gives application scope, so its acceptable. BUT I WANT TO USE META_INF/context.xml!!! Reason: i think it is neater to store application specific configuration with the rest of the application.
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/ArchiveBrowser">
<ResourceLink name="jdbc/ArchiveBrowser" type="javax.sql.DataSource"
global="jdbc/ArchiveBrowser"/>
<Environment name="AutoHelp" type="java.lang.Boolean" value="true"
description="Determines whether or not help notes are displayed automatically." />
<Environment name="BrowseCategory" type="java.lang.Boolean" value="true"
description="Determines whether or not browsing by category is enabled." />
<Environment name="BrowseFunction" type="java.lang.Boolean" value="true"
description="Determines whether or not browsing by function is enabled." />
<Environment name="BrowseKeyword" type="java.lang.Boolean" value="true"
description="Determines whether or not browsing by keyword is enabled." />
<Environment name="LikeEscape" type="java.lang.String" value="%_"
description="Identifies the pattern matching characters to be escaped in Like comparisons." />
<Environment name="DivisionList" type="java.lang.String" value=""
description="Comma separated list of Archive Server DivisionId numbers." />
</Context>
I noticed you said you had it running on 5.5. Remember this is 6.0 and things change in the Tomcat world between releases. It’s unlikely that this is a SUSE issue, they just repackage the standard Tomcat release.