求助一个spring环境报错问题

周几吉 2017-09-15 04:09:23
tomcat启动的时候,提示如下错误,请问是哪里的问题啊
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'UserServerSrv' defined in file [/Library/tomcat/apache-tomcat-7.0.79/wtpwebapps/omp-pshop-webin/WEB-INF/classes/target/classes/componentContext-Pshop.xml]: Could not resolve placeholder 'usersrv.host' in string value "http://${usersrv.host}:${usersrv.port}/${usersrv.context}/${remoteserver.context}/userservice";; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'usersrv.host' in string value "http://${usersrv.host}:${usersrv.port}/${usersrv.context}/${remoteserver.context}/userservice";


配置文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!-- UniqueID -->
<bean id="UniqueID" class="com.efuture.ocp.common.util.UniqueID">
<property name="hostId" value="60" />
</bean>

<!-- 服务版本 -->
<bean id="ServiceVersion" class="com.efuture.ocp.common.rest.ServiceVersion" lazy-init="true">
<constructor-arg name="version" value="2.0.0 build #CURRENTDATE#" />
<constructor-arg name="openlog" value="y" />
</bean>

<!-- 缓存工具 -->
<bean id="CacheUtils" class="com.efuture.ocp.common.util.CacheUtilsMemcached" lazy-init="true">
<constructor-arg name="config" value="/conf/memcached.ini" />
</bean>

<!-- REST工具 -->
<bean id="RestUtils" class="com.efuture.ocp.common.util.RestClientUtils" lazy-init="true">
<constructor-arg name="config" value="/conf/restservice.ini" />
<constructor-arg name="poolSize" value="60" />
<constructor-arg name="maxWait" value="200000" />
<property name="clientProperties">
<map>
<entry key="connectTimeout" value="5000000" />
<entry key="readTimeout" value="2000000" />
</map>
</property>
</bean>

<!-- 启用注解扫描,路径 -->
<context:component-scan base-package="com.efuture.omp"/>

<bean id="bill.common" class="com.efuture.ocp.common.billservice.BillCommonServiceImpl" lazy-init="true" />
<bean id="pshop.work.report" class="com.efuture.ocp.common.billservice.ReportServiceImpl" lazy-init="true" />
<bean id="operlog" class="com.efuture.ocp.common.billservice.BillOperLogSrvImpl" lazy-init="true" />
<bean id="globrulesrv" class="com.efuture.ocp.common.component.GlobRuleSrvimpl" lazy-init="true" />

<context:property-placeholder location="classpath*:conf/remoting.properties" ignore-unresolvable="true"/>
<bean id="UserServerSrv"
class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean" lazy-init="true" >
<property name="serviceUrl"
value="http://${usersrv.host}:${usersrv.port}/${usersrv.context}/${remoteserver.context}/userservice">
</property>
<property name="serviceInterface" value="com.efuture.ocp.user.UserService">
</property>
</bean>

<bean id="UserDataRangeSrv" class="com.efuture.ocp.common.user.UserDataRangeSrv">
<property name="openrange"
value="true" >
</property>
</bean>

<!-- Operation log -->
<!-- <bean id="OperationLog" class="com.efuture.ocp.common.entity.OperationLogBean" scope="prototype">
<property name="ignore">
<map>
<entry key="flag">
<value>flag</value>
</entry>
</map>
</property>
</bean> -->

</beans>
...全文
323 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
chho93 2017-09-25
  • 打赏
  • 举报
回复
nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'usersrv.host' in string value "http://${usersrv.host}:${usersrv.port}/${usersrv.context}/${remoteserver.context}/userservice";
程序员爱酸奶 2017-09-20
  • 打赏
  • 举报
回复
你的userservice这个id找不到对应的类,应该是id名没有对应上,你是dao.xml service.xml action.xml 分开写的吧?每一层之间的id名和ref值要对应才行
周几吉 2017-09-19
  • 打赏
  • 举报
回复


详细报错截图

我同事的也是这个文件,但是都不报错
枫醉秋 2017-09-15
  • 打赏
  • 举报
回复
<bean id="UserServerSrv" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean" lazy-init="true" > <property name="serviceUrl" value="http://${usersrv.host}:${usersrv.port}/${usersrv.context}/${remoteserver.context}/userservice"> </property> <property name="serviceInterface" value="com.efuture.ocp.user.UserService"> </property> </bean> usersrv.host 这个找不到值
李德胜1995 2017-09-15
  • 打赏
  • 举报
回复
nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 。。。 检查一下key是不是对应上了???

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧