Open meiMingle opened 2 years ago
Now I'm sure this exception happens after I installed BashSupport Pro plugin, it disables the idea bundled Shell Script plugin
(Author of BashSupport Pro here) Apologies for the problems! I briefly checked the code of this plugin. As far as I understand, the MavenHelper plugin declares an optional dependency on the JetBrains Shell plugin (in plugin.xml). But the code seems to use it always, not just when the Shell plugin is actually enabled. https://github.com/krasa/MavenHelper/blob/cb7818af5890f65f9e7adf4f32cc09592b9f4ee2/src/main/java/krasa/mavenhelper/action/ProgramRunnerUtils.java
BashSupport Pro disables the Shell plugin, that‘s correct. But manually disabling it would have the same effect. Either check in your code if JetBrains Shell is available at runtime, or make it a custom extension point which is only loaded when the Shell plugin is available, or make it a hard/non-optional dependency.
@meiMingle as a workaround, just enable the JetBrains Shell plugin again. It just work and BashSupport Pro‘s notification should remain silent after the 2nd or 3rd time it‘s shown. Please let me know if that‘s not working for you…
(Author of BashSupport Pro here) Apologies for the problems! I briefly checked the code of this plugin. As far as I understand, the MavenHelper plugin declares an optional dependency on the JetBrains Shell plugin (in plugin.xml). But the code seems to use it always, not just when the Shell plugin is actually enabled. https://github.com/krasa/MavenHelper/blob/cb7818af5890f65f9e7adf4f32cc09592b9f4ee2/src/main/java/krasa/mavenhelper/action/ProgramRunnerUtils.java
BashSupport Pro disables the Shell plugin, that‘s correct. But manually disabling it would have the same effect. Either check in your code if JetBrains Shell is available at runtime, or make it a custom extension point which is only loaded when the Shell plugin is available, or make it a hard/non-optional dependency.
@meiMingle as a workaround, just enable the JetBrains Shell plugin again. It just work and BashSupport Pro‘s notification should remain silent after the 2nd or 3rd time it‘s shown. Please let me know if that‘s not working for you…
If I follow this workaround, I wonder if enabling both BashSupport Pro and JetBrains Shell would cause a conflict.
@meiMingle Both plugins are assigned to the same file extensions, add menu items to create new shell files, BashSupport Pro supports Shell‘s run configurations, etc. I‘ve tried to make things work even with Shell enabled, but it‘s still possible that I haven‘t found all of the conflicts and problems. If possible, it should be turned off. If that‘s not possible, e.g. because another plugin needs it, it should work okay with both plugins. If you have questions, I think it‘s best to move to BashSupport Pro‘s support channels, https://www.bashsupport.com/support/
@krasa Please let me know if I can help to get this fixed.
Hello, the problem was that I was checking that the Terminal plugin is enabled, but not the Shell Script plugin.
But using it together with BashSupport Pro is kinda not compatible. It either fails on:
java.lang.ClassCastException: class pro.bashsupport.g cannot be cast to class com.intellij.sh.run.ShRunConfiguration (pro.bashsupport.g is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @247dc319; com.intellij.sh.run.ShRunConfiguration is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @18cf62a5)
at krasa.mavenhelper.action.ProgramRunnerUtils.executeInTerminal(ProgramRunnerUtils.java:97)
at krasa.mavenhelper.action.ProgramRunnerUtils.run(ProgramRunnerUtils.java:34)
at krasa.mavenhelper.action.RunGoalAction.run(RunGoalAction.java:67)
at krasa.mavenhelper.action.RunGoalAction.actionPerformed(RunGoalAction.java:62)
at krasa.mavenhelper.action.RunGoalAction.actionPerformed(RunGoalAction.java:54)
at krasa.mavenhelper.action.QuickRunMavenGoalAction$MyActionGroup.actionPerformed(QuickRunMavenGoalAction.java:221)
(I've added a check for that)
or the IDE initializes differently and my code works, but BashSupport throws:
pro.bashsupport.gj@4f9b66aa produced wrong type
java.lang.ClassCastException: class com.intellij.sh.run.ShRunConfiguration cannot be cast to class pro.bashsupport.g (com.intellij.sh.run.ShRunConfiguration is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @500f7588; pro.bashsupport.g is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @48383836)
at pro.bashsupport.bo.setupConfigurationFromContext(bo.java:12)
at com.intellij.execution.actions.RunConfigurationProducer.createConfigurationFromContext(RunConfigurationProducer.java:100)
at com.intellij.execution.actions.PreferredProducerFind.doGetConfigurationsFromContext(PreferredProducerFind.java:119)
at com.intellij.execution.actions.PreferredProducerFind.getConfigurationsFromContext(PreferredProducerFind.java:100)
at com.intellij.execution.actions.ConfigurationContext.createConfigurationsFromContext(ConfigurationContext.java:423)
at com.intellij.execution.ExecutorRegistryImpl$ExecutorAction.getRunConfigsForCurrentFile(ExecutorRegistryImpl.java:462)
at com.intellij.execution.ExecutorRegistryImpl$ExecutorAction.getRunCurrentFileActionStatus(ExecutorRegistryImpl.java:408)
at com.intellij.execution.ExecutorRegistryImpl$ExecutorAction.getRunCurrentFileActionStatus(ExecutorRegistryImpl.java:387)
at com.intellij.execution.ExecutorRegistryImpl$ExecutorAction.update(ExecutorRegistryImpl.java:345)
at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performDumbAwareUpdate$0(ActionUtil.java:150)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:173)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:660)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$updateActionReal$4(ActionUpdater.java:128)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:173)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:153)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.updateActionReal(ActionUpdater.java:129)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$0(ActionUpdater.java:116)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.update(ActionUpdater.java:649)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:498)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$20(ActionUpdater.java:477)
at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1398)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:477)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:550)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$20(ActionUpdater.java:477)
at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1398)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:477)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:550)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$20(ActionUpdater.java:477)
at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1398)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:477)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:272)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$12(ActionUpdater.java:340)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$13(ActionUpdater.java:359)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1154)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$tryRunReadActionAndCancelBeforeWrite$17(ActionUpdater.java:391)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:158)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.tryRunReadActionAndCancelBeforeWrite(ActionUpdater.java:387)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$14(ActionUpdater.java:359)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:365)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroupAsync$15(ActionUpdater.java:358)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun$$$capture(BoundedTaskExecutor.java:241)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:31)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:214)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:212)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:203)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Through learning I think I now have the skills to help deal with this problem, I will debug and solve it in my spare time
Describe the bug Got a NoClassDefFoundError when Ctrl+Shift+R to run mvnd clean install -DskipTests
To Reproduce Steps to reproduce the behavior: Idea 2022.2.1 、Mavenhelper 4.21.222.2964.0 Expected behavior
Screenshots
Environment : Use
Help | About | Copy
buttonAdditional context Add any other context about the problem here.