Announcement Announcement Module
Collapse
No announcement yet.
Problem using webapp.root system property in unit test Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem using webapp.root system property in unit test

    Hi,

    I implemented a webAppRootKey in my web.xml using the context param & the WebAppRootListener. In my spring configuration i set up PropertyPlaceholderConfigurer as follows

    Code:
    <bean id="systemPlaceholderConfigurer"	class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
    and reference the property as follows

    Code:
    <property name="fileName" 				value="${webapp.root}/myLogs.log" />
    This works fine when I run my application in the container, however when I run my unit tests I get the following error where it cannot resolve the property.

    org.springframework.beans.factory.BeanDefinitionSt oreException: Error registering bean with name 'reporter' defined in ServletContext resource [/spring/reportContext.xml]: Could not resolve placeholder 'webapp.root'

    I'm just wondering how can I use the webapp root key in unit tests

    Thanks
Working...
X