2 u013899461 u013899461 于 2018.02.13 22:59 提问

IncompatibleClassChangeError: Implementing class 5C

启动项目报错:找了网上很多方法去尝试过了,什么jar包冲突,我都试过。就是解决不了,只要我在pom.xml注释掉mybatis-plus这个jar包就不会报错,但是我又要用到这个jar包。(我这个项目在另外一台电脑上传到github的(这台能正常跑的),然后又从另一台电脑从github上下载下来,启动就报错。)
java.lang.IncompatibleClassChangeError: Implementing class
at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_65]
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) ~[?:1.8.0_65]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.8.0_65]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[?:1.8.0_65]
at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[?:1.8.0_65]
at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[?:1.8.0_65]
at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[?:1.8.0_65]
at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_65]
at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[?:1.8.0_65]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_65]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_65]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_65]
at java.lang.Class.forName(Class.java:264) ~[?:1.8.0_65]
at com.alibaba.druid.util.Utils.loadClass(Utils.java:203) ~[druid-1.1.5.jar:1.1.5]
at com.alibaba.druid.pool.vendor.MySqlValidConnectionChecker.(MySqlValidConnectionChecker.java:48) ~[druid-1.1.5.jar:1.1.5]
at com.alibaba.druid.pool.DruidDataSource.initValidConnectionChecker(DruidDataSource.java:1159) ~[druid-1.1.5.jar:1.1.5]
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:836) [druid-1.1.5.jar:1.1.5]
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1215) [druid-1.1.5.jar:1.1.5]
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:1211) [druid-1.1.5.jar:1.1.5]
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:105) [druid-1.1.5.jar:1.1.5]
at com.baomidou.mybatisplus.toolkit.GlobalConfigUtils.setMetaData(GlobalConfigUtils.java:187) [mybatis-plus-support-2.1.9.jar:?]
at com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean.buildSqlSessionFactory(MybatisSqlSessionFactoryBean.java:560) [mybatis-plus-core-2.1.9.jar:?]
at com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean.afterPropertiesSet(MybatisSqlSessionFactoryBean.java:385) [mybatis-plus-core-2.1.9.jar:?]
at com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean.getObject(MybatisSqlSessionFactoryBean.java:608) [mybatis-plus-core-2.1.9.jar:?]
at com.kalvin.hi.config.MyBatisPlusConfig.sqlSessionFactory(MyBatisPlusConfig.java:54) [classes/:?]
at com.kalvin.hi.config.MyBatisPlusConfig$$EnhancerBySpringCGLIB$$ae8cc6e8.CGLIB$sqlSessionFactory$0() [classes/:?]
at com.kalvin.hi.config.MyBatisPlusConfig$$EnhancerBySpringCGLIB$$ae8cc6e8$$FastClassBySpringCGLIB$$86cddba.invoke() [classes/:?]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) [spring-core-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358) [spring-context-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at com.kalvin.hi.config.MyBatisPlusConfig$$EnhancerBySpringCGLIB$$ae8cc6e8.sqlSessionFactory() [classes/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_65]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_65]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_65]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_65]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType(AbstractAutowireCapableBeanFactory.java:1342) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1249) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) [spring-beans-4.3.14.RELEASE.jar:4.3.14.RELEASE]

3个回答

caozhy
caozhy   Ds   Rxr 2018.02.14 00:05

遇到这种问题,如果都解决不了,就重新拿jar源代码编译下。

beesman
beesman   2018.02.14 13:11

排序一下jar包, 有一个jar包引入了两个, 找到它的版本旧, 从maven中删除掉它

u013899461
u013899461 都试过了,没有找到重复的。
3 个月之前 回复
u013899461
u013899461   2018.02.16 11:38

终于找到错误原因:是因为jdk的里面有一个mysql的驱动包跟项目中的驱动包冲突了。删除了就没报错了!

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!