krasa / MavenHelper

IntelliJ plugin - https://plugins.jetbrains.com/plugin/7179
Apache License 2.0
254 stars 92 forks source link

update to the latest version and Throw an exception #75

Open bpzhang opened 3 years ago

bpzhang commented 3 years ago

java.lang.ClassCastException: class krasa.mavenhelper.MyProjectService cannot be cast to class krasa.mavenhelper.MyProjectService (krasa.mavenhelper.MyProjectService is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @6e3b5838; krasa.mavenhelper.MyProjectService is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @2a4b0567)
    at krasa.mavenhelper.MyProjectService.getInstance(MyProjectService.java:22)
    at krasa.mavenhelper.analyzer.GuiForm.<init>(GuiForm.java:125)
    at krasa.mavenhelper.analyzer.UIFormEditor.<init>(UIFormEditor.java:35)
    at krasa.mavenhelper.analyzer.MyFileEditorProvider.createEditor(MyFileEditorProvider.java:45)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.dumbModeFinished(FileEditorManagerImpl.java:285)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl$1.lambda$exitDumbMode$0(FileEditorManagerImpl.java:182)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
    at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:350)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
    at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    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.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:887)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:756)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:443)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:442)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:488)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)```
krasa commented 3 years ago

Seems like IntelliJ bug. You could try uninstalling the plugin. It works fine for me.

krasa commented 3 years ago

It reminds me https://youtrack.jetbrains.com/issue/IDEA-237519 when plugins were in a wrong location. Your IDE version?

KarlManong commented 3 years ago

I got the same exception

java.lang.ClassCastException: class krasa.mavenhelper.MyProjectService cannot be cast to class krasa.mavenhelper.MyProjectService (krasa.mavenhelper.MyProjectService is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @64930b87; krasa.mavenhelper.MyProjectService is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @756220b7)
    at krasa.mavenhelper.MyProjectService.getInstance(MyProjectService.java:22)
    at krasa.mavenhelper.analyzer.GuiForm.<init>(GuiForm.java:125)
    at krasa.mavenhelper.analyzer.UIFormEditor.<init>(UIFormEditor.java:35)
    at krasa.mavenhelper.analyzer.MyFileEditorProvider.createEditor(MyFileEditorProvider.java:45)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4Edt(FileEditorManagerImpl.java:997)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$17(FileEditorManagerImpl.java:969)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.runBulkTabChange(FileEditorManagerImpl.java:1786)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$18(FileEditorManagerImpl.java:968)
    at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:438)
    at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:456)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4(FileEditorManagerImpl.java:965)
    at com.jetbrains.rdserver.editors.BackendServerFileEditorManager.openFileImpl4(BackendServerFileEditorManager.kt:63)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl2$14(FileEditorManagerImpl.java:891)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:207)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:172)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:162)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:148)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl2(FileEditorManagerImpl.java:890)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileWithProviders(FileEditorManagerImpl.java:764)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileWithProviders(FileEditorManagerImpl.java:731)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openEditorImpl$22(FileEditorManagerImpl.java:1269)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:207)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:172)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:162)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:148)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openEditorImpl(FileEditorManagerImpl.java:1263)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileEditor(FileEditorManagerImpl.java:1239)
    at com.intellij.openapi.fileEditor.FileEditorManager.openEditor(FileEditorManager.java:222)
    at com.intellij.openapi.fileEditor.FileNavigatorImpl.navigateInAnyFileEditor(FileNavigatorImpl.java:81)
    at com.intellij.openapi.fileEditor.FileNavigatorImpl.navigateInEditor(FileNavigatorImpl.java:62)
    at com.intellij.openapi.fileEditor.FileNavigatorImpl.navigateInEditorOrNativeApp(FileNavigatorImpl.java:47)
    at com.intellij.openapi.fileEditor.FileNavigatorImpl.navigate(FileNavigatorImpl.java:30)
    at com.intellij.openapi.fileEditor.OpenFileDescriptor.navigate(OpenFileDescriptor.java:91)
    at com.intellij.psi.impl.source.PsiFileImpl.navigate(PsiFileImpl.java:912)
    at com.intellij.codeInsight.navigation.NavigationUtil.lambda$openFileWithPsiElement$2(NavigationUtil.java:177)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:216)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:172)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:162)
    at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:148)
    at com.intellij.codeInsight.navigation.NavigationUtil.openFileWithPsiElement(NavigationUtil.java:170)
    at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:263)
    at com.intellij.ide.projectView.impl.nodes.AbstractPsiBasedNode.navigate(AbstractPsiBasedNode.java:273)
    at com.intellij.ide.projectView.impl.nodes.PsiFileNode.navigate(PsiFileNode.java:116)
    at com.intellij.util.OpenSourceUtil.navigateToSource(OpenSourceUtil.java:119)
    at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:74)
    at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:58)
    at com.intellij.util.OpenSourceUtil.navigate(OpenSourceUtil.java:51)
    at com.intellij.util.OpenSourceUtil.openSourcesFrom(OpenSourceUtil.java:19)
    at com.intellij.util.EditSourceOnDoubleClickHandler$TreeMouseListener.processDoubleClick(EditSourceOnDoubleClickHandler.java:172)
    at com.intellij.util.EditSourceOnDoubleClickHandler$TreeMouseListener.onDoubleClick(EditSourceOnDoubleClickHandler.java:166)
    at com.intellij.ui.DoubleClickListener.onClick(DoubleClickListener.java:30)
    at com.intellij.ui.ClickListener$1.mouseReleased(ClickListener.java:59)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
    at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
    at com.intellij.ui.treeStructure.Tree.processMouseEvent(Tree.java:394)
    at com.intellij.ide.dnd.aware.DnDAwareTree.processMouseEvent(DnDAwareTree.java:44)
    at java.desktop/java.awt.Component.processEvent(Component.java:6417)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    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:2784)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    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:887)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:816)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:753)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:443)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:442)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:494)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
KarlManong commented 3 years ago

I'm using the latest stable idea ultimate and the latest plugin

krasa commented 3 years ago

:( I've hidden the update for now https://plugins.jetbrains.com/plugin/7179-maven-helper/versions/stable/135611

KarlManong commented 3 years ago

4.15.212.000.0 works well.

krasa commented 3 years ago

Could you paste the content from Help | About | Copy?

hsz commented 3 years ago

Could you please attach idea.log logs? You can upload it securely here: https://uploads.jetbrains.com and provide the generated name.

KarlManong commented 3 years ago

Could you paste the content from Help | About | Copy?

Manual installed with version https://plugins.jetbrains.com/plugin/7179-maven-helper/versions/stable/135611, and everything works fine. I don't know why.

Current I have no way to reproduce. Sorry for that.

ahus1 commented 3 years ago

I've seen a similar exception with a plugin that I maintain, and with other JetBrains plugins. Please let me know I you feel offended by hijacking this. Seen with IntelliJ IDEA 2021.2.1 Build #IU-212.5080.55. / cc: @hsz

2021-08-31 22:53:34,519 [46126956]  ERROR - mpl.search.PsiSearchHelperImpl - Error during processing of: plugin.xml 
java.lang.ClassCastException: class com.intellij.psi.impl.source.xml.XmlTagImpl cannot be cast to class [Ljava.lang.Object; (com.intellij.psi.impl.source.xml.XmlTagImpl is in unnamed module of loader com.intellij.util.lang.PathClassLoader @2d3fcdbd; [Ljava.lang.Object; is in module java.base of loader 'bootstrap')

I happen to have a log file. I uploaded it here: Upload id: 2021_09_06_VJBTEFWbMmimysgg (file: idea.log.1)

annaMarchenkoJetBrains commented 3 years ago

@ahus1 thank you very much for providing your idea.log, it helped me to reproduce the problem. I filed an issue https://youtrack.jetbrains.com/issue/IDEA-277738 You can follow the state of the ticket there.

annaMarchenkoJetBrains commented 3 years ago

@ahus1 please try the latest nightly https://confluence.jetbrains.com/display/IDEADEV/IDEA+2021.2+latest+builds Does it work for you? I can reproduce the same problem only on IU-212.5080.55, but not on IU-212.5284.31 I would say, the issue is fixed and will not reproduce in new builds

ahus1 commented 3 years ago

Hi @annaMarchenkoJetBrains - I see that IU-212.5284.31 is the 2021.2.2 RC, and I'll install it.

I have never been able to reproduce the issue intentionally, I only looked at my logs now and then.

Is there anything I should try out?

annaMarchenkoJetBrains commented 3 years ago

@ahus1 the issue is unfortunately unstable to reproduce and I saw it already on all three builds - your current, on IU-212.5284.31 and on the most recent build which is not available for users. I will keep you posted and inform you when we fix it and the fix will be included in the future builds. Thanks

P.S. The issue happens during analysing of file when you open a file in the Editor. Probably, Android plugins should be disabled.

krasa commented 3 years ago

@annaMarchenkoJetBrains any workaround? Why does it happen only after a plugin update? https://github.com/krasa/FrameSwitcher/issues/35

krasa commented 3 years ago

Hmm, it should be fixed in 213.3565, 212.5394 - https://youtrack.jetbrains.com/issue/IDEA-277738

Deathef commented 3 years ago

java.lang.IllegalArgumentException: Argument for @NotNull parameter 'project' of org/jetbrains/idea/maven/project/MavenProjectsManager.getInstance must not be null at org.jetbrains.idea.maven.project.MavenProjectsManager.$$$reportNull$$$0(MavenProjectsManager.java) at org.jetbrains.idea.maven.project.MavenProjectsManager.getInstance(MavenProjectsManager.java) at krasa.mavenhelper.analyzer.action.BaseAction.getVirtualFile(BaseAction.java:155) at krasa.mavenhelper.analyzer.action.BaseAction.getNavigatable(BaseAction.java:141) at krasa.mavenhelper.analyzer.MyHighlightingTree.getData(MyHighlightingTree.java:63) at com.intellij.ide.impl.DataManagerImpl.getDataFromProvider(DataManagerImpl.java:66) at com.intellij.openapi.actionSystem.impl.PreCachedDataContext.preGetAllData(PreCachedDataContext.java:170) at com.intellij.openapi.actionSystem.impl.PreCachedDataContext.(PreCachedDataContext.java:72) at com.intellij.openapi.actionSystem.impl.Utils.wrapToAsyncDataContext(Utils.java:69) at com.intellij.openapi.actionSystem.impl.Utils.wrapDataContext(Utils.java:82) at com.intellij.openapi.actionSystem.impl.ActionToolbarImpl.updateActionsImpl(ActionToolbarImpl.java:1132) at com.intellij.openapi.actionSystem.impl.ActionToolbarImpl$1.updateActionsImpl(ActionToolbarImpl.java:177) at com.intellij.openapi.actionSystem.impl.ToolbarUpdater$MyUpdateRunnable.run(ToolbarUpdater.java:155) at com.intellij.util.ui.EdtInvocationManager.invokeLaterIfNeeded(EdtInvocationManager.java:101) at com.intellij.ide.IdeEventQueue.ifFocusEventsInTheQueue(IdeEventQueue.java:186) at com.intellij.ide.IdeEventQueue.executeWhenAllFocusEventsLeftTheQueue(IdeEventQueue.java:140) at com.intellij.openapi.wm.impl.FocusManagerImpl.doWhenFocusSettlesDown(FocusManagerImpl.java:175) at com.intellij.openapi.actionSystem.impl.ToolbarUpdater.updateActions(ToolbarUpdater.java:76) at com.intellij.openapi.actionSystem.impl.ToolbarUpdater$MyTimerListener.run(ToolbarUpdater.java:125) at com.intellij.openapi.actionSystem.impl.WeakTimerListener.run(WeakTimerListener.java:35) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$MyTimer.runListenerAction(ActionManagerImpl.java:1716) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$MyTimer.actionPerformed(ActionManagerImpl.java:1706) at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:317) at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:249) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776) 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.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:885) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:754) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:441) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:440) at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

krasa commented 3 years ago

@Deathef fixed.