为了账号安全,请及时绑定邮箱和手机立即绑定

hiberbate和spring整合时出错

hiberbate和spring整合时出错

王伟_学习 2015-11-11 19:22:08
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">        <!-- 设置数据源 -->        <property name="dataSource" ref="dataSource"/>        <!-- 接管了hibernate对象映射文件 -->        <property name="mappingResources">            <list>              <value>com/domain/Employee.hbm.xml</value>            </list>        </property>        <property name="hibernateProperties">            <value>                hibernate.dialect=org.hibernate.dialect.MySQLDialect                hibernate.hbm2dd1.auto=update                hibernate.show_sql=false            </value>        </property>    </bean> Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: TRACE    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:610)    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)    at com.test.Test.main(Test.java:16)Caused by: java.lang.NoSuchFieldError: TRACE哪位大神知道啊
查看完整描述

1 回答

?
雲中菩提

TA贡献6条经验 获得超3个赞

应该是jar包冲突引起的。

查看完整回答
反对 回复 2015-11-11
  • 1 回答
  • 0 关注
  • 1652 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信