有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java BeanCreationException休眠5。LocalSessionFactoryBean Bean属性“EL”不可写或具有无效的setter方法

我正在从Hibernate 3/Spring 3迁移到Hibernate 5/Spring 4,并收到以下错误:

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'sessionFactory-ETL' defined in class path resource 
[config/context-hm.xml]: Error setting property values; nested 
exception is org.springframework.beans.NotWritablePropertyException: Invalid 
property 'eL' of bean class 
[org.springframework.orm.hibernate5.LocalSessionFactoryBean]: Bean property 
'eventListeners' is not writable or has an invalid setter method. Does the 
parameter type of the setter match the return type of the getter?

以下是配置文件的一部分:

   <bean name="hibernateEventListeners" class="org.springframework.beans.factory.config.MapFactoryBean">
    <property name="sourceMap">
        <map>
            <entry key="pre-update" value-ref="pup" />
            <entry key="save-update" value-ref="xSaS" />
            <entry key="post-insert" value-ref="xIS" />
            <entry key="merge" value-ref="xML" />
            <entry key="pre-delete" value-ref="eRUL" />
        </map>
    </property>
</bean>

<bean id="sessionFactory-ETL"
  class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">

<property name="eventListeners" ref="hibernateEventListeners" />

有人能解释一下吗?我不确定是否需要将hibernateEventListeners的类型更改为MapFactoryBean以外的类型


共 (0) 个答案