当前位置 博文首页 > 适己而忘人者,人之所弃;克己而立人者,众之所戴。:解决问题(

    适己而忘人者,人之所弃;克己而立人者,众之所戴。:解决问题(

    作者:[db:作者] 时间:2021-07-11 16:09

    ?今天主要遇到的问题是启动Server之后就会出现以下错误:

    2007-10-25 10:20:05,562 ERROR [BasicLazyInitializer] CGLIB Enhancement failed: com.fullproject.vo.User
    net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null

    2007-10-25 10:20:05,578 WARN? [PojoEntityTuplizer] could not create proxy factory for:com.fullproject.vo.User
    org.hibernate.HibernateException: CGLIB Enhancement failed: com.fullproject.vo.User
    Caused by: net.sf.cglib.core.CodeGenerationException: java.lang.reflect.InvocationTargetException-->null
    Caused by: java.lang.reflect.InvocationTargetException
    Caused by: java.lang.SecurityException: class "com.fullproject.vo.User$$EnhancerByCGLIB$$feaea099"'s signer information does not match signer information of other classes in the same package

    主要原因是用MyEclipse搭建工程时,会导入Spring和Hibernate各所需要的包,其中:

    Spring的AOP编程时,会用到这几个lib:
    asm-2.2.3.jar
    asm-commons-2.2.3.jar
    asm-util-2.2.3.jar
    cglib-nodep-2.1_3.jar

    Hibernate也包含类似的包lib:
    asm.jar
    asm-attrs.jar
    cglib-2.1.3.jar
    而导致的包冲突。

    在网上查得的资料是说把以上Hibernate的包删掉,但是在我的环境中并不起效。相反我删掉的是以上Spring所用的包,但不是全部只有asm-2.2.3.jar和cglib-nodep-2.1_3.jar。问题解决。

    参考网址:http://hi.baidu.com/hateeyes/blog/item/741acbd47cb43403a08bb771.html


    ?

    cs