mybatis 错误CGLIB is not available

### Error querying database. Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not available. Add CGLIB to your classpath.
### The error may exist in letv/bdp/mapper/meta/IDbTableMapper.java (best guess)
### The error may involve letv.bdp.mapper.meta.IDbTableMapper.queryColsByTable-Inline
### The error occurred while setting parameters
### SQL: select * from bdp_data_relation_table_column rtc where rtc.table_id=?
### Cause: java.lang.IllegalStateException: Cannot enable lazy loading because CGLIB is not available. Add CGLIB to your classpath.

 

 

今天用mybatis时出现的问题  使用到One注解 可能要动态反射吧

 

出现问题的原因:1.未添加cglib包 2.未添加asm包 3.版本冲突 这两个包需要用以下对应版本配合 Spring 3.1.2   否则会引发:java.lang.IncompatibleClassChangeError: class net.sf.cglib.core.DebuggingClassWriter has interface org.objectweb.asm.ClassVisitor as super class

 

 

修改pom文件

<dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>2.2</version>
        </dependency>
<dependency>
            <groupId>asm</groupId>
            <artifactId>asm</artifactId>
            <version>3.3.1</version>
        </dependency>

 

posted @ 2016-09-22 16:12  Mr.Ming2  阅读(3944)  评论(0编辑  收藏  举报