Error 404 when reading properties file in spring
I am trying to read data from properties file.I have specified the path in xml.When I run the app it throws an error -
* org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'fbStuffKeeper' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Could not resolve placeholder 'facebook.appId'
My 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 contain-
facebook.appID=xxxxxxxxxxxxxxxxxx
facebook.appSecret=xxxxxxxxxxxxxxxxxx
redirect.uri=http:xxxxxxxxxxxxxxxxxx
Have I specified the path of the properties file correctly..Where did I go wrong?? Kindly correct me
看起来像最后一个d
的错误案例: facebook.appId
而不是facebook.appID
上一篇: 在Spring应用程序上下文中的Integer.decode()
下一篇: 在春天读取属性文件时发生错误404