Glassfish Java App Class cast exception

269 Views Asked by At

Getting the following exception when casting

fqe.dataHandler.LiveUpdateMessage cannot be cast to fqe.dataHandler.LiveUpdateMessage

Sometimes it happens, sometimes it doesn't. The object can never be anything other than that class.

If it helps this is when getting the Object from grizzly-comet's CometEvent.message() function on GlassFish 3.

Thanks in advance for any help.

1

There are 1 best solutions below

1
On BEST ANSWER

This is usually due in a Servlet Engine when you have two instances of a jar file being loaded by different ClassLoaders. Maybe one in a WAR and another in the classpath of the engine ?