Skip to content

Class initialization must not depend on services. Consider using instance of the service on-demand instead. #2822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jonathanlermitage opened this issue May 17, 2025 · 2 comments

Comments

@jonathanlermitage
Copy link

Have you checked the issues and discussions to ensure there are no duplicates?

Yes

Are you using JetBrains Client / Code With Me / IntelliJ Remote Development?

No

Your programming languages

Java, Python

Free or paid?

Paid users

Expected Behavior

.

Current Behavior

I get this error report on IDE start (this does not break the plugin):

java.lang.Throwable: ќᾖ <clinit> requests com.intellij.compiler.impl.javaCompiler.javac.JavacConfiguration instance. Class initialization must not depend on services. Consider using instance of the service on-demand instead.
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:375)
	at com.intellij.serviceContainer.ComponentManagerImplKt.checkOutsideClassInitializer(ComponentManagerImpl.kt:1587)
	at com.intellij.serviceContainer.ComponentManagerImplKt.getOrCreateInstanceBlocking(ComponentManagerImpl.kt:1556)
	at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:754)
	at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:698)
	at com.intellij.compiler.impl.javaCompiler.javac.JavacConfiguration.getOptions(JavacConfiguration.java:44)
	at てΒ.ほÅ(Unknown Source)
	at ќᾖ$Ҽઐ$3.invoke(Unknown Source)
	at ќᾖ$Ҽઐ.invoke(Unknown Source)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:83)
	at ќᾖ.ᆮ〢(Unknown Source)
	at Ṹἓ.ほÅ(Unknown Source)
	at ќᾖ$ↂử.invoke(Unknown Source)
	at սḆ.ほÅ(Unknown Source)
	at սḆ.<init>(Unknown Source)
	at ќᾖ.<clinit>(Unknown Source)
	at ӣთ$ᆮ〢.invokeSuspend(Unknown Source)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at kotlinx.coroutines.internal.SoftLimitedDispatcher$Worker.run(SoftLimitedDispatcher.kt:130)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:613)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:1183)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:778)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:765)

This is a common issue with IJ 2025. I also faced this with my plugins. Now, the IDE throws an error if we get a service in a constructor or in a static field. We should get services later.

Code snippet for reproduce

Open a project in IntelliJ.

Your Environment

IntelliJ IDEA 2025.2 EAP (Ultimate Edition)
Build #IU-252.13776.59, built on May 14, 2025
Source revision: c8425a73e3c43
Licensed to IntelliJ IDEA EAP user: Jonathan Lermitage
Expiration date: June 13, 2025
Runtime version: 21.0.7+9-b968.13 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.X11.XToolkit
Linux 6.12.28-1-lts
EndeavourOS; glibc: 2.41
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 4
Registry:
  ide.experimental.ui=true
  ide.slow.operations.assertion=false
Non-Bundled Plugins:
  lermitage.ij.all.pack (2025.1.5)
  com.ultrahob.zerolength.plugin (0.95)
  lermitage.intellij.ilovedevtoys (1.11.0)
  ru.adelf.idea.dotenv (252.13776.59)
  PythonCore (252.13776.59)
  org.toml.lang (252.13776.68)
  lermitage.intellij.iconviewer (1.31.3)
  name.kropp.intellij.makefile (252.13776.59)
  com.intellij.properties (252.13776.68)
  com.intellij.velocity (252.13776.68)
  com.haulmont.jpab (252.13776.59)
  lermitage.intellij.worldclock (1.8.0)
  com.github.camork.fileExpander (2.5)
  String Manipulation (9.15.0)
  Pythonid (252.13776.59)
  com.intellij.ml.llm (252.13776.59)
  lermitage.intellij.battery.status (2.5)
  org.jetbrains.junie (251.105.47)
  MavenRunHelper (4.29.0-IJ2022.2)
  dev.turingcomplete.intellijdevelopertoolsplugins (7.0.0)
  org.jetbrains.plugins.vue (252.13776.68)
  org.jetbrains.plugins.node-remote-interpreter (252.13776.68)
  com.deadlock.scsyntax (252.13776.68)
  izhangzhihao.rainbow.brackets (2024.2.11-241)
Kotlin: 252.13776.59-IJ
Current Desktop: KDE
@dosubot dosubot bot added the IDE issue label May 17, 2025
Repository owner deleted a comment from dosubot bot May 17, 2025
@izhangzhihao
Copy link
Owner

Please try this build snapshot:

intellij-rainbow-brackets-2024.2.11-241.zip

@jonathanlermitage
Copy link
Author

Hi @izhangzhihao

No more error report with this build. Everything works fine. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants