As @kocko suggests, this is most likely a classloader issue.
The true runtime identity of an object type depends on the class, and the classloader that loaded it.
If your runtime framework has multiple (unrelated) classloaders, and you load the same class in two or more of them, then the end result is different classes that have the same name. Even if the code of the two "versions" of the class is identical.
Note that different "webapps" in the same JVM could well have different classloaders. If you have a situation where objects are being created by one webapp and passed to another, you can have problems with the types being incompatible.
Can you point me at some resources on how to track something like this down?
Here are some tips:
Get hold of the
Class
objects involved in the comparison, and confirm whether they areequal
. If not check what their respective class names and classloaders are.Examine all of the JAR files to see if the offending class is in multiple JARs.
Read the Weblogic documentation to see how it manages the classloaders. Then check the way that you have configured them.