One of our apps declare some parameters in Tomcat's context.xml as such:
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Parameter name="defaultSchema" override="true" value="demo"/>
<Resource
auth="Container"
description="DB Connection for Local Jazzee"
driverClassName="oracle.jdbc.OracleDriver"
. . .
/>
</Context>
And then in Spring's applicationContext.xml we are able to use that parameter when we instantiate some beans:
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.default_schema">${defaultSchema}</prop>
. . .
</bean>
And that works fine.
Problem I'm having is that I'm trying to duplicate this in another application, and it's not working. When I try to start the app, I get the error:
Invalid bean definition with name 'sessionFactory' defined in class path resource [db/applicationContext.xml]: Could not resolve placeholder 'defaultSchema'
It's the same developer Tomcat instance in both cases, so the Tomcat version is the same. The Spring library versions appear to be the same as well. Also, if I hardcode the schema name in the application context, it works fine. So the dataSource is fine.
Any thoughts on what might be breaking this functionality?