continue icon indicating copy to clipboard operation
continue copied to clipboard

ClassCastException for AutocompleteService

Open tmibkr opened this issue 1 year ago • 0 comments

Before submitting your bug report

Relevant environment info

- OS: Windows Server 2022 Datacenter
- Continue: 0.0.38
- IDE: Intellij Ultimate 2023.3.2
- jdk 17

Description

Sometimes the following error is reported by intellij.

java.lang.ClassCastException: class com.github.continuedev.continueintellijextension.autocomplete.AutocompleteService cannot be cast to class com.github.continuedev.continueintellijextension.autocomplete.AutocompleteService (com.github.continuedev.continueintellijextension.autocomplete.AutocompleteService is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @546cb6ec; com.github.continuedev.continueintellijextension.autocomplete.AutocompleteService is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @62f603e1)
    at com.github.continuedev.continueintellijextension.autocomplete.AutocompleteEditorListener.editorCreated(AutocompleteEditorListener.kt:46)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl.lambda$doCreateEditor$4(EditorFactoryImpl.java:229)
    at com.intellij.openapi.extensions.impl.ExtensionProcessingHelper.forEachExtensionSafe(ExtensionProcessingHelper.kt:34)
    at com.intellij.openapi.extensions.ExtensionPointName.forEachExtensionSafe(ExtensionPointName.kt:50)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl.doCreateEditor(EditorFactoryImpl.java:229)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(EditorFactoryImpl.java:203)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl.createViewer(EditorFactoryImpl.java:173)
    at com.intellij.execution.impl.ConsoleViewUtil.setupConsoleEditor(ConsoleViewUtil.java:47)
    at com.intellij.execution.impl.ConsoleViewImpl.doCreateConsoleEditor(ConsoleViewImpl.java:905)
    at com.intellij.execution.impl.ConsoleViewImpl.createConsoleEditor(ConsoleViewImpl.java:886)
    at com.intellij.execution.impl.ConsoleViewImpl.initConsoleEditor(ConsoleViewImpl.java:483)
    at com.intellij.execution.impl.ConsoleViewImpl.getComponent(ConsoleViewImpl.java:449)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil.lambda$createSyncDescriptor$0(ExternalSystemUtil.java:519)
    at com.intellij.build.MultipleBuildsView.lambda$onEvent$4(MultipleBuildsView.java:159)
    at com.intellij.build.MultipleBuildsView.lambda$onEvent$5(MultipleBuildsView.java:290)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:194)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:843)
    at com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:463)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1436)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:124)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:44)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:589)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:44)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
    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)

To reproduce

First noticed this after the following simple steps:

  1. Restart intellij

It happened again after the following steps:

  1. Starting intellij
  2. Open a file
  3. "Split Down" the window

Another time after the followings steps:

  1. Press shift-shift to open the command palette
  2. Select a file to open
  3. After the file opens, the error occurs

Another time after the following steps:

  1. Open the gradle tab (within a java 17 gradle project)
  2. Click the gradle reload button
  3. The error occurs

Note that doing the same steps again did not reproduce the issue, but restarting intellij (via the restart menu option, not quitting and opening again) resulted in Continue failing to load any models in the dropdown menu (defaults show up after cycling through the options). Disabling the plugin, applying the change, enabling the plugin, applying the change again results in the configured models correctly appearing.

Log output

See the attached stack trace

tmibkr avatar Mar 21 '24 02:03 tmibkr