简体   繁体   English

Glassfish Java App类强制转换异常

[英]Glassfish Java App Class cast exception

Getting the following exception when casting 投射时获取以下异常

fqe.dataHandler.LiveUpdateMessage cannot be cast to fqe.dataHandler.LiveUpdateMessage 无法将fqe.dataHandler.LiveUpdateMessage强制转换为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. 如果有帮助,请从GlassFish 3上的grizzly-comet的CometEvent.message()函数获取对象。

Thanks in advance for any help. 在此先感谢您的帮助。

This is usually due in a Servlet Engine when you have two instances of a jar file being loaded by different ClassLoaders. 这通常是由于在Servlet引擎中,当您​​有两个jar文件实例由不同的ClassLoader加载时。 Maybe one in a WAR and another in the classpath of the engine ? 也许一个在战争中而另一个在引擎的类路径中?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM