You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ClassCastException on ShimManagerService happens when two modules (possibly dependant to one another), use the following dependencies declaration
classDiagram
components <|-- components-demo
direction LR
Loading
repositories {
intellijPlatform {
defaultRepositories() // CCE raised in second module
jetbrainsRuntime()
}
}
Looking at the code I noticed this in IntelliJPlatformRepositoriesHelper (called by createJetBrainsCdnArtifactsRepository, note this method is removed in 55eaa4d, but the field remains)
Build file '/Users/brice.dutheil/opensource/intellij-platform-swing-components/components-demo-plugin/build.gradle.kts' line: 30
class org.jetbrains.intellij.platform.gradle.services.ShimManagerService$Inject cannot be cast to class org.jetbrains.intellij.platform.gradle.services.ShimManagerService (org.jetbrains.intellij.platform.gradle.services.ShimManagerService$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @76b77cf8; org.jetbrains.intellij.platform.gradle.services.ShimManagerService is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @36699c9e)
* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org/.
* Exception is:
java.lang.ClassCastException: class org.jetbrains.intellij.platform.gradle.services.ShimManagerService$Inject cannot be cast to class org.jetbrains.intellij.platform.gradle.services.ShimManagerService (org.jetbrains.intellij.platform.gradle.services.ShimManagerService$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @76b77cf8; org.jetbrains.intellij.platform.gradle.services.ShimManagerService is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @36699c9e)
at org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformRepositoriesHelper.createJetBrainsCdnArtifactsRepository$IntelliJ_Platform_Gradle_Plugin(IntelliJPlatformRepositoriesHelper.kt:157)
at org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformRepositoriesExtension.jetBrainsCdn(IntelliJPlatformRepositoriesExtension.kt:195)
at org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformRepositoriesExtension.jetBrainsCdn$default(IntelliJPlatformRepositoriesExtension.kt:195)
at org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformRepositoriesExtension.defaultRepositories(IntelliJPlatformRepositoriesExtension.kt:211)
at Build_gradle$1$1.execute(build.gradle.kts:30)
at Build_gradle$1$1.execute(build.gradle.kts:29)
at org.gradle.internal.extensibility.ExtensionsStorage$ExtensionHolder.configure(ExtensionsStorage.java:177)
at org.gradle.internal.extensibility.ExtensionsStorage.configureExtension(ExtensionsStorage.java:64)
at org.gradle.internal.extensibility.DefaultConvention.configure(DefaultConvention.java:207)
at org.gradle.kotlin.dsl.Accessors71yjfozemurtyc5m7du5ty1x0Kt.intellijPlatform(Unknown Source)
at Build_gradle$1.invoke(build.gradle.kts:29)
at Build_gradle$1.invoke(build.gradle.kts:26)
at org.gradle.kotlin.dsl.ProjectExtensionsKt.repositories(ProjectExtensions.kt:217)
at Build_gradle.<init>(build.gradle.kts:26)
...
Steps to reproduce
I'm not quite sure what caused this at this time, this was happening on
What happened?
The
ClassCastException
onShimManagerService
happens when two modules (possibly dependant to one another), use the following dependencies declarationLooking at the code I noticed this in
IntelliJPlatformRepositoriesHelper
(called bycreateJetBrainsCdnArtifactsRepository
, note this method is removed in 55eaa4d, but the field remains)The exception indicates the class is incorrect, indeed module have different classloaders
components
module:InstrumentingVisitableURLClassLoader(ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:]:buildSrc[:]:root-project[:]:project-components(export)})
components-demo-plugin
module:InstrumentingVisitableURLClassLoader(ClassLoaderScopeIdentifier.Id{coreAndPlugins:settings[:]:buildSrc[:]:root-project[:]:project-components-demo-plugin(export)})
So shared services in multi module and with configuration cache appear to be subject to CCE. See
Workaround: Declare the plugin on the root project without applying it
Relevant log output or stack trace
Steps to reproduce
I'm not quite sure what caused this at this time, this was happening on
https://github.com/bric3/intellij-platform-swing-components/tree/4e57ab2efcab28e739a3bd8f6874e17b2fe1c087
Gradle IntelliJ Plugin version
2.0.0-beta8
Gradle version
8.8
Operating System
macOS
Link to build, i.e. failing GitHub Action job
No response
The text was updated successfully, but these errors were encountered: