java.lang.RuntimeException: No ClassLoaders found for: net.sf.hibernate.collection.Se

java.lang.RuntimeException: No ClassLoaders found for: net.sf.hibernate.collection.Set

Hi All,

I am migrating my project from hibernate2 to Hibernate3.6.
Please note that I have 2 JBoss servers that talk yo each other.
The project deployed on Server 1 (say 'A') is still on Hibernate2, while I have migrated the projetc on server 2(say 'B') to Hibernate3.6.
Now, an object constructed at 'A' is sent to 'B' and I am getting the above mentioned Exception a 'B'. Seems the Exception is coming while deserializing the Object at 'B' which was serialized at 'A'.

Can somebody help me out with :
1. Solution to the above problem
2. Is Hibernate 3 fully backward-compatible with Hibernate 2?

The stack Trace:
12:49:07,882 WARN [root] Clone and Redelivery property not set as expected.
12:49:08,890 ERROR [root] java.lang.RuntimeException: No ClassLoaders found for: net.sf.hibernate.collection.Set
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMg r3.java:306)
at org.jboss.mx.loading.RepositoryClassLoader.loadCla ssImpl(RepositoryClassLoader.java:521)
at org.jboss.mx.loading.RepositoryClassLoader.loadCla ss(RepositoryClassLoader.java:415)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 56)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at java.io.ObjectInputStream.resolveClass(ObjectInput Stream.java:622)

It means you can't have the two versions talking to each other.
If part of your architecture requires you to have your two servers talking to each other using Hibernate objects then that won't work if one is Hibernate 2 and the other is Hibernate 3.

Finally, i got the result. Hibernate 2.X and 3.x can co-exist together.. We just need to add the required jars in the classpath of the correct project.
i.e. put 2.x in the classpath where the project uses 2.x API and put 3.x in classpath where the project uses 3.x API. As simple as that.