# ClassNotFoundException: org hibernate.collection.PersistentSet + Hibernate 5.4

**URL:** <https://discourse.hibernate.org/t/classnotfoundexception-org-hibernate-collection-persistentset-hibernate-5-4/4590>\
**Category:** Hibernate ORM\
**Created:** [September 18, 2020, 2:09pm UTC](https://discourse.hibernate.org/t/classnotfoundexception-org-hibernate-collection-persistentset-hibernate-5-4/4590 "2020-09-18T14:09:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajarshi\_Pain](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/rajarshi_pain/32/1220_2.png) [@Rajarshi\_Pain](https://discourse.hibernate.org/u/Rajarshi_Pain)\
**Post date:** [September 18, 2020, 2:09pm UTC](https://discourse.hibernate.org/t/classnotfoundexception-org-hibernate-collection-persistentset-hibernate-5-4/4590/1 "2020-09-18T14:09:01Z")

</div>

We are migrating from hinernate 3 to 5.4.

Application is sending message to JMS queue, but while receiving we are getting this exception for some of the messages. The object we are sending has one to many relation.

Tried to find out the root cause but not able to find out why it’s referring hibernate 3 class . The Object we are sending has a one-to-many relation

We have used Spring 5.2.6,Hibernate 5.4.18, Weblogic 12.2.1.3, java 8

in the below, it is raising the exception though nowhere I have used this class

```auto
Serializable obj =((ObjectMessage) message).getObject()

```

Exception: sorry can not add the whole trace

```auto
Weblogic.jms.common.JMSException[JMSClientExceptions:055115]Error deserializing an object
. 
. 
. 
Caused By: java.lang.ClassNotFoundException: org hibernate.collection.PersistentSet

```

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [November 4, 2020, 7:59pm UTC](https://discourse.hibernate.org/t/classnotfoundexception-org-hibernate-collection-persistentset-hibernate-5-4/4590/2 "2020-11-04T19:59:25Z")

</div>

Obviously, if you are using Java Serialization, both sides, the sending and receiving side must use matching Hibernate versions. If you don’t need the persistence information, it’s probably best if you serialize the object to JSON instead or just align the Hibernate versions.
