# HHH000142 javassist enhancement failed cannot be cast to org.hibernate.proxy.hibernateproxy

**URL:** <https://discourse.hibernate.org/t/hhh000142-javassist-enhancement-failed-cannot-be-cast-to-org-hibernate-proxy-hibernateproxy/2006>\
**Category:** Hibernate ORM\
**Created:** [January 9, 2019, 5:04pm UTC](https://discourse.hibernate.org/t/hhh000142-javassist-enhancement-failed-cannot-be-cast-to-org-hibernate-proxy-hibernateproxy/2006 "2019-01-09T17:04:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nitu](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@nitu](https://discourse.hibernate.org/u/nitu)\
**Post date:** [January 9, 2019, 5:04pm UTC](https://discourse.hibernate.org/t/hhh000142-javassist-enhancement-failed-cannot-be-cast-to-org-hibernate-proxy-hibernateproxy/2006/1 "2019-01-09T17:04:59Z")

</div>

I am using hibernate 5.0.9 on EAP7.

Using JPA .

getting HHH000142 javassist enhancement failed cannot be cast to org.hibernate.proxy.hibernateproxy

what could be reason ?

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [January 9, 2019, 5:36pm UTC](https://discourse.hibernate.org/t/hhh000142-javassist-enhancement-failed-cannot-be-cast-to-org-hibernate-proxy-hibernateproxy/2006/2 "2019-01-09T17:36:23Z")

</div>

Try replicating it with this [test case template](http://in.relation.to/2016/01/14/hibernate-jpa-test-case-template/).

---

<div class="post-metadata">

**Author:** ![nitu](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@nitu](https://discourse.hibernate.org/u/nitu)\
**Post date:** [January 23, 2019, 5:04pm UTC](https://discourse.hibernate.org/t/hhh000142-javassist-enhancement-failed-cannot-be-cast-to-org-hibernate-proxy-hibernateproxy/2006/3 "2019-01-23T17:04:42Z")

</div>

Hi,  
Just want to throw more light on the issue.  
We are using JBOSS EAP7. Its BOM gets 4.2.24 Hibernate.  
The hibernate in turn brings javassist 3.18.1.

we are continuously getting error of HHH000142 javassist enhancement failed org.hibernate.proxy.pojo.javassist.javassistproxyfactory.getproxy(javassistproxyfactory.java:130)

what could be issue ?

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [January 23, 2019, 5:11pm UTC](https://discourse.hibernate.org/t/hhh000142-javassist-enhancement-failed-cannot-be-cast-to-org-hibernate-proxy-hibernateproxy/2006/4 "2019-01-23T17:11:31Z")

</div>

Hibernate 4.x is very old. You might want to try with a newer version of Hibernate and see if the problem was fixed in the meanwhile.

---

<div class="post-metadata">

**Author:** ![nitu](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@nitu](https://discourse.hibernate.org/u/nitu)\
**Post date:** [January 23, 2019, 5:18pm UTC](https://discourse.hibernate.org/t/hhh000142-javassist-enhancement-failed-cannot-be-cast-to-org-hibernate-proxy-hibernateproxy/2006/5 "2019-01-23T17:18:09Z")

</div>

Actually we are working on a migration project from EAP 6 to EAP7.

the customer’s application users Hibernate 3.  
when we migrate to EAP7, it has default packaging of Hibernate 4.2.24.

Moving directly to Hibernate 5 is not recommended as it will cause lot of changes in customer code.

thanks for your prompt revert !!

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [January 23, 2019, 7:03pm UTC](https://discourse.hibernate.org/t/hhh000142-javassist-enhancement-failed-cannot-be-cast-to-org-hibernate-proxy-hibernateproxy/2006/6 "2019-01-23T19:03:22Z")

</div>

Even if you don’t migrate to Hibernate 5, it’s still better to address this issue to the JBoss or Wildfly forum.
