xplanner 在jdk1.6上部署问题

很早的时候就想尝试使用XPlanner,但是一直都没有成功,感觉很简单

但是运行时总是报spring的一个配置文件出错

今天终于在网上找到解决方案了

原来是因为XPlanner部署在JDK1.6上的问题

http://jira.codehaus.org/browse/XPR-391

错误如下:

ERROR - alina].[localhost].[/xplanner] - Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘metaRepository’ defined in class path resource [spring-beans.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.apache.commons.collections.map.LinkedMap] to required type [java.util.HashMap] for property ‘repositories’]
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.apache.commons.collections.map.LinkedMap] to required type [java.util.HashMap] for property ‘repositories’
at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:839)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:584)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:469)

原来是spring-beans.xml文件中的问题

就是这个部分

<bean id=”metaRepository” class=”com.technoetic.xplanner.domain.repository.MetaRepositoryImpl”>
<property name=”repositories”>
<map>

com.technoetic.xplanner.domain.repository.MetaRepositoryImpl的repositories需要一个map,

spring中使用使用的实现是org.apache.commons.collections.map.LinkedMap

但是org.apache.commons.collections.map.LinkedMap实现了java.util.Map接口啊!

理论上应该的可以的啊!但是却出现了转化错误,没有找到原因,但是找到了解决方案啊!

把<property name=”repositories”><map>……</map></property>

修改为

<property name=”repositories”>
<bean class=”java.util.HashMap”>
<constructor-arg>
<map>…..</map>
</constructor-arg>
</bean>
</property>

就可以了啊!
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值