I have an application in which I am trying to use the PropertyPlaceholderConfigurer to filter application properties in 2 seperate *.xml files.
The 2 files are:
applicationContext.xml
mytest-servlet.xml (spring servlet configuration)
mytest-servlet.xml filters without any problem. For some strange reason applicationContext.xml does not filter and I recieve the error message:
[/WEB-INF/applicationContext.xml]: Could not resolve placeholder 'hibernate.show_sql'
web.xml
--------------
applicationContext.xmlCode:<context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/applicationContext.xml </param-value> </context-param> <servlet> <servlet-name>context</servlet-name> <servlet-class> org.springframework.web.context.ContextLoaderServlet </servlet-class> <load-on-startup>2</load-on-startup> </servlet> <servlet> <servlet-name>mytest</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>3</load-on-startup> </servlet>
---------------------------------
configuration.properties (located on the classpath)Code:<beans> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:configuration.properties"/> </bean> <!-- Database Property --> <bean id="hibernateProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="properties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop> <prop key="hibernate.query.substitutions">true 'Y', false 'N'</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.jdbc.batch_size">20</prop> </props> </property> </bean> </beans>
----------------------------
hibernate.show_sql=true
any ideas?


Reply With Quote