报错信息:
org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'sessionFactory' defined in servletContext resource [/WEB-INF/spring/ezone/applicationContext.xml]:Error setting property values;nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'configLocations' of bean class [org.springframework.orm.hibernate3.localSessionFactoryBean] : Bean property 'configLocations' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?applicationContext.xml代码<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="exposeTransactionAwareSessionFactory">
<value>false</value>
</property>
<property name="configLocations">
<list>
<value>/WEB-INF/hibernate/ezone/hibernate-ezone.cfg.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
${hibernate.dialect}
</prop>
<prop key="hibernate.show_sql">
${jdbc.show_sql}
</prop>
</props>
</property>
</bean>
hibernate-ezone.cfg.xml 代码
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.show_sql">false</property> <mapping resource="com/thtf/ezone/ezframework/user/entity/EzfUser.hbm.xml"/>
<mapping resource="com/thtf/ezone/ezframework/user/entity/QuickEzfUser.hbm.xml"/ </session-factory>
</hibernate-configuration>
上文中的hbm.xml文件都在jar中封装了。weblogic.xml
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<context-root>pems</context-root>
<charset-params>
<input-charset>
<resource-path>/*</resource-path>
<java-charset-name>utf-8</java-charset-name>
</input-charset>
</charset-params>
</weblogic-web-app>
org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'sessionFactory' defined in servletContext resource [/WEB-INF/spring/ezone/applicationContext.xml]:Error setting property values;nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'configLocations' of bean class [org.springframework.orm.hibernate3.localSessionFactoryBean] : Bean property 'configLocations' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?applicationContext.xml代码<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref local="dataSource" />
</property>
<property name="exposeTransactionAwareSessionFactory">
<value>false</value>
</property>
<property name="configLocations">
<list>
<value>/WEB-INF/hibernate/ezone/hibernate-ezone.cfg.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
${hibernate.dialect}
</prop>
<prop key="hibernate.show_sql">
${jdbc.show_sql}
</prop>
</props>
</property>
</bean>
hibernate-ezone.cfg.xml 代码
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.show_sql">false</property> <mapping resource="com/thtf/ezone/ezframework/user/entity/EzfUser.hbm.xml"/>
<mapping resource="com/thtf/ezone/ezframework/user/entity/QuickEzfUser.hbm.xml"/ </session-factory>
</hibernate-configuration>
上文中的hbm.xml文件都在jar中封装了。weblogic.xml
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<context-root>pems</context-root>
<charset-params>
<input-charset>
<resource-path>/*</resource-path>
<java-charset-name>utf-8</java-charset-name>
</input-charset>
</charset-params>
</weblogic-web-app>
解决方案 »
- 求个torque整合struts1,spring的demo
- mysql if exists问题
- 关于SSH的问题---------大家进来帮个忙
- netbean开发j2ee需要安装什么,如何配置?
- 阻止标准脚本元素方面的问题!!!!!!!!!!!!!!!
- 关于使用JSTL的问题!!!!急哦!!!!!
- javamail程序收不了邮件
- 如何对已经生成的Document对象做schema校验
- 关于Java客户端如何去连接C++服务端
- (Unsupported major.minor version 50.0)问题。
- 如何用超链接读取文件,将文件内容直接显示在页面里?
- Struts2+Hibernate3.3级联保存
:Error creating bean with name 'sessionFactory' defined in servletContext resource [/WEB-INF/spring/ezone/applicationContext