javassist两个jar包导致:.Department_$$_javassist_1 cannot be cast to javassist.util.proxy.Proxy

当处理如下代码:


1

2

Javassist Enhancement failed: com.entities.Department

java.lang.ClassCastException: com.entities.Department_$$_javassist_1 cannot be cast to javassist.util.proxy.Proxy


1

2

3

<many-to-one name="department" class="com.entities.Department">

           <column name="DEPARTMENT_ID"/>

       </many-to-one>

当输出数据到页面时候出现如下错误:


1

2

Javassist Enhancement failed: com.entities.Department

java.lang.ClassCastException: com.entities.Department_$$_javassist_1 cannot be cast to javassist.util.proxy.Proxy

原因是有两个javassis的jar包,一个是hibernate的,一个是struts2的...,把低版本的删掉即可!

来自为知笔记(Wiz)

时间: 2024-10-13 06:20:10