java.lang.ClassCastException: class com.alibabacloud.intellij.cosy.editor.CosyInlayManagerImpl cannot be cast to class com.alibabacloud.intellij.cosy.editor.CosyInlayManager (com.alibabacloud.intellij.cosy.editor.CosyInlayManagerImpl is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @783fa01f; com.alibabacloud.intellij.cosy.editor.CosyInlayManager is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @22196ea9)
at com.alibabacloud.intellij.cosy.editor.CosyInlayManager.getInstance(CosyInlayManager.java:23)
at com.alibabacloud.intellij.cosy.listener.CosyInlayCompletionSelectionListener.selectionChanged(CosyInlayCompletionSelectionListener.java:28)
at com.intellij.openapi.editor.impl.SelectionModelImpl.broadcastSelectionEvent(SelectionModelImpl.java:78)
at com.intellij.openapi.editor.impl.SelectionModelImpl.fireSelectionChanged(SelectionModelImpl.java:72)
at com.intellij.openapi.editor.impl.CaretImpl.lambda$doSetSelection$6(CaretImpl.java:1156)
at com.intellij.openapi.editor.impl.CaretModelImpl.doWithCaretMerging(CaretModelImpl.java:421)
at com.intellij.openapi.editor.impl.CaretImpl.doSetSelection(CaretImpl.java:1070)
at com.intellij.openapi.editor.impl.CaretImpl.setSelection(CaretImpl.java:1060)
at com.intellij.openapi.editor.impl.CaretImpl.setSelection(CaretImpl.java:1052)
at com.intellij.openapi.editor.SelectionModel.setSelection(SelectionModel.java:185)
at com.intellij.openapi.editor.impl.EditorImpl.setSelectionAndBlockActions(EditorImpl.java:2753)
at com.intellij.openapi.editor.impl.EditorImpl.processMouseDragged(EditorImpl.java:2610)
at com.intellij.openapi.editor.impl.EditorImpl.lambda$runMouseDraggedCommand$19(EditorImpl.java:2471)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:174)
at com.intellij.openapi.editor.impl.EditorImpl.runMouseDraggedCommand(EditorImpl.java:2471)
at com.intellij.openapi.editor.impl.EditorImpl$MyMouseMotionListener.lambda$mouseDragged$0(EditorImpl.java:4410)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
at com.intellij.openapi.editor.impl.EditorImpl$MyMouseMotionListener.mouseDragged(EditorImpl.java:4410)
at java.desktop/java.awt.Component.processMouseMotionEvent(Component.java:6702)
at java.desktop/javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3363)
at java.desktop/java.awt.Component.processEvent(Component.java:6423)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4564)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2793)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:898)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:743)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:439)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:803)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:438)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:119)
at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:604)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:436)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:873)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:484)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
ClassCastException,即类型转换异常
类加载器问题:不同的类加载器加载了相同的类,但是 JVM 将它们视为不同的类。在这种情况下,即使两个类具有相同的完全限定名,它们也不能进行强制转换。
使用 -Xverify:none 参数:虽然不推荐在生产环境中使用,但作为临时解决方案,你可以尝试在启动参数中添加 -Xverify:none 来禁用类验证,看看是否能够解决问题。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。