我正在尝试在tomcat上部署spring项目的war文件。在部署时,我在日志中收到关注错误。
org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: /${X_CONF_DIR}/ext-catalog/app.properties (No such file or directory)
.
我在bash_profile上定义了X_CONF_DIR,当我键入cmd env时,X_CONF_DIR正确显示。
我尝试了
cd /${X_CONF_DIR}/ext-catalog/
它要去那个位置。但是仍然不知何故我最终遇到了filenotfound异常。
config.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<context:property-placeholder
location="file:///${X_CONF_DIR}/ext-catalog/app.properties,
file:///${X_CONF_DIR}/ext-catalog/mongo.properties,
file:///${X_CONF_DIR}/ext-catalog/solr.properties,
file:///${X_CONF_DIR}/ext-catalog/redis.properties,
file:///${X_CONF_DIR}/ext-catalog/domain-event-publisher.properties,
file:///${X_CONF_DIR}/ext-catalog/domain-event-subscriber.properties"
properties-ref="applicationDefaultProperties" ignore-resource-not-found="false"
ignore-unresolvable="false"/>