maven+spring3+hibernate3+sturts2启动tomcat报java.lang.IncompatibleClassChangeError

jy03204102 2012-07-21 09:20:03
异常:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'boardDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.orm.hibernate3.HibernateTemplate com.baobaotao.dao.BaseDao.hibernateTemplate; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [baobaotao-dao.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 class path resource [baobaotao-dao.xml]: Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.orm.hibernate3.HibernateTemplate com.baobaotao.dao.BaseDao.hibernateTemplate; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [baobaotao-dao.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 class path resource [baobaotao-dao.xml]: Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:506)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)
... 28 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [baobaotao-dao.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 class path resource [baobaotao-dao.xml]: Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:848)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:790)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:707)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
... 30 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [baobaotao-dao.xml]: Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Implementing class
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
... 43 more
Caused by: java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getDeclaredConstructor(Class.java:1985)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:104)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newConfiguration(LocalSessionFactoryBean.java:818)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:549)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 50 more

google看了很多帖子 大多数说是jar包重复 纠结了2天没解决~~
...全文
378 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
cxxcheng 2012-07-23
  • 打赏
  • 举报
回复
看看你配置文件呗!
jy03360200 2012-07-23
  • 打赏
  • 举报
回复
jar包冲突
jy03204102 2012-07-21
  • 打赏
  • 举报
回复
mvn dependency:tree
[INFO] +- junit:junit:jar:4.8.2:test
[INFO] +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] +- javax.servlet:jstl:jar:1.2:provided
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided
[INFO] +- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.6.12:compile
[INFO] +- commons-io:commons-io:jar:2.1:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.2:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- commons-chain:commons-chain:jar:1.2:compile
[INFO] +- commons-digester:commons-digester:jar:2.1:compile
[INFO] | \- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] +- commons-validator:commons-validator:jar:1.4.0:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] +- net.sf.json-lib:json-lib:jar:jdk15:2.4:compile
[INFO] | \- net.sf.ezmorph:ezmorph:jar:1.0.6:compile
[INFO] +- asm:asm:jar:3.1:compile
[INFO] +- asm:asm-attrs:jar:2.2.3:compile
[INFO] +- asm:asm-commons:jar:3.3.1:compile
[INFO] | \- asm:asm-tree:jar:3.3.1:compile
[INFO] +- org.springframework.osgi:spring-osgi-core:jar:1.1.3:compile
[INFO] | \- org.springframework.osgi:spring-osgi-io:jar:1.1.3:compile
[INFO] +- org.springframework.osgi:spring-osgi-mock:jar:1.1.3:compile
[INFO] +- quartz:quartz:jar:1.5.1:compile
[INFO] +- org.springframework:spring-aop:jar:3.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-asm:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-core:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:3.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:3.1.0.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:3.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:3.1.0.RELEASE:compile
[INFO] +- org.apache.struts:struts2-core:jar:2.3.1.1:compile
[INFO] | +- org.apache.struts.xwork:xwork-core:jar:2.3.1.1:compile
[INFO] | +- org.freemarker:freemarker:jar:2.3.18:compile
[INFO] | +- ognl:ognl:jar:3.0.3:compile
[INFO] | | \- javassist:javassist:jar:3.11.0.GA:compile
[INFO] | \- com.sun:tools:jar:1.5.0:system
[INFO] +- org.apache.struts:struts2-spring-plugin:jar:2.3.1.1:compile
[INFO] +- org.apache.struts:struts2-json-plugin:jar:2.3.1.1:compile
[INFO] +- org.apache.struts:struts2-jfreechart-plugin:jar:2.3.1.1:compile
[INFO] +- org.apache.struts:struts2-convention-plugin:jar:2.3.1.1:compile
[INFO] +- antlr:antlr:jar:2.7.7:compile
[INFO] +- org.hibernate:hibernate-core:jar:3.6.9.Final:compile
[INFO] | +- org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final:compile
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] | \- javax.transaction:jta:jar:1.1:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.4:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.4:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.18:compile
[INFO] +- oracle:ojdbc14_g:jar:10.2.0.4:compile
[INFO] +- proxool:proxool:jar:0.9.0RC3:compile
[INFO] +- org.apache.maven:maven-embedder:jar:2.0:compile
[INFO] +- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] +- org.unitils:unitils-core:jar:3.1:test
[INFO] +- org.unitils:unitils-database:jar:3.1:test
[INFO] | \- commons-dbcp:commons-dbcp:jar:1.2.2:test
[INFO] | \- commons-pool:commons-pool:jar:1.3:test
[INFO] +- org.unitils:unitils-dbmaintainer:jar:3.1:test
[INFO] | \- org.hibernate:hibernate:jar:3.2.5.ga:test
[INFO] | +- net.sf.ehcache:ehcache:jar:1.2.3:test
[INFO] | \- cglib:cglib:jar:2.1_3:test
[INFO] +- org.unitils:unitils-dbunit:jar:3.1:test
[INFO] +- org.unitils:unitils-orm:jar:3.1:test
[INFO] | \- javax.persistence:persistence-api:jar:1.0:test
[INFO] +- org.unitils:unitils-spring:jar:3.1:test
[INFO] +- org.apache.poi:poi:jar:3.2-FINAL:test
[INFO] +- org.mockito:mockito-all:jar:1.8.5:test
[INFO] +- org.hamcrest:hamcrest-all:jar:1.3:test
[INFO] +- org.dbunit:dbunit:jar:2.4.8:test
[INFO] \- org.springframework.web:spring-web-servlet:jar:3.1.0.RELEASE:compile
jy03204102 2012-07-21
  • 打赏
  • 举报
回复
mvn dependency:tree
[INFO] +- junit:junit:jar:4.8.2:test
[INFO] +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] +- javax.servlet:jstl:jar:1.2:provided
[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided
[INFO] +- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.6.12:compile
[INFO] +- commons-io:commons-io:jar:2.1:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.2:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- commons-chain:commons-chain:jar:1.2:compile
[INFO] +- commons-digester:commons-digester:jar:2.1:compile
[INFO] | \- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] +- commons-validator:commons-validator:jar:1.4.0:compile
[INFO] +- commons-lang:commons-lang:jar:2.6:compile
[INFO] +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] +- net.sf.json-lib:json-lib:jar:jdk15:2.4:compile
[INFO] | \- net.sf.ezmorph:ezmorph:jar:1.0.6:compile
[INFO] +- asm:asm:jar:3.1:compile
[INFO] +- asm:asm-attrs:jar:2.2.3:compile
[INFO] +- asm:asm-commons:jar:3.3.1:compile
[INFO] | \- asm:asm-tree:jar:3.3.1:compile
[INFO] +- org.springframework.osgi:spring-osgi-core:jar:1.1.3:compile
[INFO] | \- org.springframework.osgi:spring-osgi-io:jar:1.1.3:compile
[INFO] +- org.springframework.osgi:spring-osgi-mock:jar:1.1.3:compile
[INFO] +- quartz:quartz:jar:1.5.1:compile
[INFO] +- org.springframework:spring-aop:jar:3.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-asm:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-core:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:3.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:3.1.0.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:3.1.0.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:3.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:3.1.0.RELEASE:compile
[INFO] +- org.apache.struts:struts2-core:jar:2.3.1.1:compile
[INFO] | +- org.apache.struts.xwork:xwork-core:jar:2.3.1.1:compile
[INFO] | +- org.freemarker:freemarker:jar:2.3.18:compile
[INFO] | +- ognl:ognl:jar:3.0.3:compile
[INFO] | | \- javassist:javassist:jar:3.11.0.GA:compile
[INFO] | \- com.sun:tools:jar:1.5.0:system
[INFO] +- org.apache.struts:struts2-spring-plugin:jar:2.3.1.1:compile
[INFO] +- org.apache.struts:struts2-json-plugin:jar:2.3.1.1:compile
[INFO] +- org.apache.struts:struts2-jfreechart-plugin:jar:2.3.1.1:compile
[INFO] +- org.apache.struts:struts2-convention-plugin:jar:2.3.1.1:compile
[INFO] +- antlr:antlr:jar:2.7.7:compile
[INFO] +- org.hibernate:hibernate-core:jar:3.6.9.Final:compile
[INFO] | +- org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final:compile
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] | \- javax.transaction:jta:jar:1.1:compile
[INFO] +- log4j:log4j:jar:1.2.16:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.4:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.4:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.18:compile
[INFO] +- oracle:ojdbc14_g:jar:10.2.0.4:compile
[INFO] +- proxool:proxool:jar:0.9.0RC3:compile
[INFO] +- org.apache.maven:maven-embedder:jar:2.0:compile
[INFO] +- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] +- org.unitils:unitils-core:jar:3.1:test
[INFO] +- org.unitils:unitils-database:jar:3.1:test
[INFO] | \- commons-dbcp:commons-dbcp:jar:1.2.2:test
[INFO] | \- commons-pool:commons-pool:jar:1.3:test
[INFO] +- org.unitils:unitils-dbmaintainer:jar:3.1:test
[INFO] | \- org.hibernate:hibernate:jar:3.2.5.ga:test
[INFO] | +- net.sf.ehcache:ehcache:jar:1.2.3:test
[INFO] | \- cglib:cglib:jar:2.1_3:test
[INFO] +- org.unitils:unitils-dbunit:jar:3.1:test
[INFO] +- org.unitils:unitils-orm:jar:3.1:test
[INFO] | \- javax.persistence:persistence-api:jar:1.0:test
[INFO] +- org.unitils:unitils-spring:jar:3.1:test
[INFO] +- org.apache.poi:poi:jar:3.2-FINAL:test
[INFO] +- org.mockito:mockito-all:jar:1.8.5:test
[INFO] +- org.hamcrest:hamcrest-all:jar:1.3:test
[INFO] +- org.dbunit:dbunit:jar:2.4.8:test
[INFO] \- org.springframework.web:spring-web-servlet:jar:3.1.0.RELEASE:compile

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧