title: How to cast two instance of the same loaded different classloader?
body: <p>I have two different webapps, and each load the same class A with different classloader. When I put one instance in the session and then get it from the other webapp, a <code>ClassCastException</code> is thrown.</p>
  
  <p>For example, in webapp A, I store <code>a</code> in the session, then in webapp B, I get the <code>a</code> from the session and cast it to A, the <code>ClassCastException</code> is thrown.</p>
  
  <p>Is there a way to resolve this?</p>