我正在尝试在tomcat上设置几个Web应用程序,但是没有获取任何属性文件
2014-02-19 15:47:02,106 - WARN org.springframework.core.io.support.PropertiesLoaderSupport - Could not load properties from class
path resource [indexing.properties]: class path resource [indexing.properties] cannot be opened because it does not exist
2014-02-19 15:47:02,110 - WARN org.springframework.core.io.support.PropertiesLoaderSupport - Could not load properties from class
path resource [user-service.properties]: class path resource [user-service.properties] cannot be opened because it does not exist
2014-02-19 15:47:05,169 - WARN com.cubeia.backoffice.users.Configuration - No user-service.properties configuration file found. U
sing default.
/WEB-INF/classes/service.xml文件具有以下定义:
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:default-indexing.properties</value>
<value>classpath:indexing.properties</value>
</list>
</property>
<property name="ignoreResourceNotFound" value="true" />
</bean>
我尝试将.property文件复制到我能想到的任何地方。tomcat / conf,tomcat / lib,tomcat / conf / Catalina,tomcat / conf / catalina / localhost,webapps // WEB-INF /,webapps // WEB-INF / classes /,然后也位于与实际目录相同的目录中。类文件,临时目录,您为它命名。只是不会拿起它。
以后的编辑:我还尝试了/ WEB-INF / classes,WEB-INF /,tomcat / conf,tomcat / lib,classpath *等值:...基本上所有可能的组合。
您应该将属性文件放在webapp的src / main / resources目录中。然后,Maven(假设您正在使用maven)会将文件复制到您的WEB-INF / classes目录中,并将其放在您的类路径中。然后,如果您遵循@arahant的回答,一切都会好起来的。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句