0 Replies Latest reply on Jun 30, 2005 5:52 PM by lhoriman

    Not the usual ClassCastException

      Frequently (but not every time) after redeploying my application, I get an odd ClassCastException when looking up the interface for a Stateful Session Bean. It looks like the typical exception other people are seeing with the new WAR file behavior. In my webapp,

      conv = (Conversation)ctx.lookup(Conversation.class.getName());
      yields:
      java.lang.ClassCastException: $Proxy118

      However, my problem is not the usual one - it only happens after redeployment (intermittently), and I am absolutely certain that there is only one instance of my interface classes in my package.

      My deployment structure may be slightly unusual. I package most of the JARs used by my ejbs in a SAR contained within my EAR, like this:

      application.ear
      + webapp.war (does not contain interface classes)
      + core.ejb3 (does not contain interface classes)
      + core.sar
      | + commons-logging.jar (etc... other 3rdparty jars)
      | + core-client.jar (contains ejb3 interface classes only)

      This started happening in a head build at least a month ago, probably about the time that the classloader changes were made. Before then redeployment was always successful. The strangest thing is that now sometimes redeployment works, sometimes it doesn't, and I haven't been able to determine any pattern to it.

      Any ideas?

      Thanks in advance,
      Jeff Schnitzer
      Voodoodyne Inc.