springMVC+hibernate整合出错
Errorcreatingbeanwithname'userDao'definedinServletContextresource[/WEB-INF/spring-dao...
Error creating bean with name 'userDao' defined in ServletContext resource [/WEB-INF/spring-dao.xml]: Cannot resolve reference to bean 'hibernateTemplate' while setting bean property 'hibernateTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in ServletContext resource [/WEB-INF/spring-hibernate.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring-hibernate.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: xmlHelper
错误信息如上面所示,其中应该是sessionFactory没配对,nested exception is java.lang.NoSuchFieldError: xmlHelper这一句错误信息比较蹊跷,不太明白
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<!-- key的名字前面都要加hibernate. -->
<prop key="hibernate.dialect">
<!-- org.hibernate.dialect.MySQLDialect -->
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
<property name="mappingLocations">
<list>
<value>classpath:/com/dall/pojo/*.hbm.xml</value>
</list>
</property>
</bean> 展开
错误信息如上面所示,其中应该是sessionFactory没配对,nested exception is java.lang.NoSuchFieldError: xmlHelper这一句错误信息比较蹊跷,不太明白
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="hibernateProperties">
<props>
<!-- key的名字前面都要加hibernate. -->
<prop key="hibernate.dialect">
<!-- org.hibernate.dialect.MySQLDialect -->
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.hbm2ddl.auto">update</prop>
</props>
</property>
<property name="mappingLocations">
<list>
<value>classpath:/com/dall/pojo/*.hbm.xml</value>
</list>
</property>
</bean> 展开
1个回答
2014-06-04
展开全部
那个类,没有那个xmlHelper属性
java.lang.NoSuchFieldError: xmlHelper
java.lang.NoSuchFieldError: xmlHelper
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询