在春天读取属性文件时发生错误404

我正在尝试从属性文件中读取数据。我在xml中指定了路径。当我运行该应用程序时,它会引发错误 -

* org.springframework.beans.factory.BeanDefinitionStoreException:在ServletContext资源中定义名为'fbStuffKeeper'的无效bean定义[/WEB-INF/applicationContext.xml]:无法解析占位符'facebook.appId'

我的applicationContext.xml -

    <bean
        class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
    <bean
        class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
    <context:component-scan base-package="com.cognizant.awcoe.bazaar.social.spring.controllers" use-default-filters="false">
        <context:include-filter expression="org.springframework.stereotype.Controller" type="annotation" />
    </context:component-scan>
    <bean
        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
             <property name="location" value="classpath:/com/social/spring/config/facebook.properties"/>
    </bean>
    <bean id="fbStuffKeeper" class="com.social.spring.facebook.FBStuffManager">
        <property name="secret" value="${facebook.appSecret}"/>
        <property name="clientId" value="${facebook.appId}"/>
        <property name="redirectURI" value="${redirect.uri}"/>
    </bean>
</beans>

facebook.properties包含 -

facebook.appID=xxxxxxxxxxxxxxxxxx
facebook.appSecret=xxxxxxxxxxxxxxxxxx
redirect.uri=http:xxxxxxxxxxxxxxxxxx

我是否正确指定了属性文件的路径。我在哪里出错了? 请纠正我


看起来像最后一个d的错误案例: facebook.appId而不是facebook.appID

链接地址: http://www.djcxy.com/p/65345.html

上一篇: Error 404 when reading properties file in spring

下一篇: What does java:comp/env/ do?