Skip to content
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

BugSnag fails to init in IDEA 2023.3 #4894

Closed
madisp opened this issue Dec 6, 2023 · 6 comments · Fixed by #4983 or #4988
Closed

BugSnag fails to init in IDEA 2023.3 #4894

madisp opened this issue Dec 6, 2023 · 6 comments · Fixed by #4983 or #4988

Comments

@madisp
Copy link
Contributor

madisp commented Dec 6, 2023

SQLDelight Version

2.0.1

IDE Version

IntelliJ 2023.3

Dialect

PostgreSQL

Describe the Bug

After upgrading IDEA SqlDelight starts throwing exceptions in a loop. Ironically, SqlDelightErrorHandler fails to init :D

Looking at the Stacktrace I think there's some parts of slf4j shadowed whereas they shouldn't be?

Stacktrace

Caused by: com.intellij.diagnostic.PluginException: Cannot create class app.cash.sqldelight.intellij.SqlDelightErrorHandler (classloader=PluginClassLoader(plugin=PluginDescriptor(name=SQLDelight, id=com.squareup.sqldelight, descriptorPath=plugin.xml, path=~/Library/Application Support/JetBrains/IntelliJIdea2023.3/plugins/SQLDelight, version=2.0.1, package=null, isBundled=false), packagePrefix=null, state=active))
	at com.intellij.serviceContainer.ComponentManagerImpl.doInstantiateClass(ComponentManagerImpl.kt:1401)
	at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:1377)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.instantiateClass(XmlExtensionAdapter.kt:80)
	at com.intellij.openapi.extensions.impl.SimpleConstructorInjectionAdapter.instantiateClass(XmlExtensionAdapter.kt:100)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.doCreateInstance(XmlExtensionAdapter.kt:51)
	... 987 more
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.bugsnag.Bugsnag
	at app.cash.sqldelight.intellij.SqlDelightErrorHandler.<init>(SqlDelightErrorHandler.kt:32)
	at com.intellij.serviceContainer.ComponentManagerImpl.findConstructorAndInstantiateClass(ComponentManagerImpl.kt:1383)
	at com.intellij.serviceContainer.ComponentManagerImpl.doInstantiateClass(ComponentManagerImpl.kt:1392)
	... 991 more
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.LinkageError: loader constraint violation: when resolving method 'org.slf4j.ILoggerFactory org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()' the class loader com.intellij.ide.plugins.cl.PluginClassLoader @b02d1e2 of the current class, org/slf4j/LoggerFactory, and the class loader com.intellij.ide.plugins.cl.PluginClassLoader @76cd131 for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature (org.slf4j.LoggerFactory is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @b02d1e2, parent loader 'bootstrap'; org.slf4j.impl.StaticLoggerBinder is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @76cd131, parent loader 'bootstrap') [in thread "FileBasedIndex Vfs Event Processor"]
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:423)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
	at com.bugsnag.Bugsnag.<clinit>(Bugsnag.java:27)
	at app.cash.sqldelight.intellij.SqlDelightErrorHandler.<init>(SqlDelightErrorHandler.kt:32)
	at com.intellij.serviceContainer.ComponentManagerImpl.findConstructorAndInstantiateClass(ComponentManagerImpl.kt:1383)
	at com.intellij.serviceContainer.ComponentManagerImpl.doInstantiateClass(ComponentManagerImpl.kt:1392)
	at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:1377)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.instantiateClass(XmlExtensionAdapter.kt:80)
	at com.intellij.openapi.extensions.impl.SimpleConstructorInjectionAdapter.instantiateClass(XmlExtensionAdapter.kt:100)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.doCreateInstance(XmlExtensionAdapter.kt:51)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.kt:32)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:468)
	... 73 more
@PadenZach
Copy link

+1, also happening to me in AndroidStudio 2023.1.1

@chrisjenx
Copy link

Not the same stack but similar for me on 2023.1.1 (Hedgehog)

com.intellij.diagnostic.PluginException: Cannot create extension (class=app.cash.sqldelight.intellij.SqlDelightErrorHandler) [Plugin: com.squareup.sqldelight]
	at com.intellij.serviceContainer.ComponentManagerImpl.createError(ComponentManagerImpl.kt:1096)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.doCreateInstance(XmlExtensionAdapter.kt:70)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.kt:31)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:473)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:421)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.computeExtensionList(ExtensionPointImpl.java:249)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensionList(ExtensionPointImpl.java:243)
	at com.intellij.openapi.extensions.ExtensionPointName.getExtensionList(ExtensionPointName.kt:43)
	at com.intellij.diagnostic.IdeErrorsDialog.getSubmitter(IdeErrorsDialog.java:948)
	at com.intellij.diagnostic.IdeErrorsDialog.getSubmitter(IdeErrorsDialog.java:938)
	at com.intellij.diagnostic.DefaultIdeaErrorLogger.canHandle(DefaultIdeaErrorLogger.java:46)
	at com.intellij.diagnostic.DialogAppender.appendToLoggers(DialogAppender.java:95)
	at com.intellij.diagnostic.DialogAppender.lambda$queueAppend$0(DialogAppender.java:79)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:667)
	at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$7(IdeEventQueue.kt:571)
	at com.intellij.openapi.application.impl.ApplicationImpl.withoutImplicitRead(ApplicationImpl.java:1444)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:571)
	at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:68)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:348)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:348)
	at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:343)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:995)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:995)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$4(IdeEventQueue.kt:343)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:829)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:385)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Caused by: com.intellij.diagnostic.PluginException: Cannot create class app.cash.sqldelight.intellij.SqlDelightErrorHandler (classloader=PluginClassLoader(plugin=PluginDescriptor(name=SQLDelight, id=com.squareup.sqldelight, descriptorPath=plugin.xml, path=~/Library/Application Support/Google/AndroidStudio2023.1/plugins/SQLDelight, version=2.0.1, package=null, isBundled=false), packagePrefix=null, instanceId=82, state=active))
	at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:1034)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.instantiateClass(XmlExtensionAdapter.kt:79)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter$SimpleConstructorInjectionAdapter.instantiateClass(XmlExtensionAdapter.kt:90)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.doCreateInstance(XmlExtensionAdapter.kt:50)
	... 40 more
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method 'org.slf4j.ILoggerFactory org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()' the class loader com.intellij.ide.plugins.cl.PluginClassLoader @417226f0 of the current class, org/slf4j/LoggerFactory, and the class loader com.intellij.util.lang.PathClassLoader @591f989e for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature (org.slf4j.LoggerFactory is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @417226f0, parent loader 'bootstrap'; org.slf4j.impl.StaticLoggerBinder is in unnamed module of loader com.intellij.util.lang.PathClassLoader @591f989e)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:423)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
	at com.bugsnag.Bugsnag.<clinit>(Bugsnag.java:27)
	at app.cash.sqldelight.intellij.SqlDelightErrorHandler.<init>(SqlDelightErrorHandler.kt:32)
	at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:993)
	... 43 more

@titanseason
Copy link

titanseason commented Dec 27, 2023

The same for me

com.intellij.diagnostic.PluginException: Cannot create extension (class=app.cash.sqldelight.intellij.SqlDelightErrorHandler) [Plugin: com.squareup.sqldelight]
// ...

Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.LinkageError: loader constraint violation: when resolving method 'org.slf4j.ILoggerFactory org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()' the class loader com.intellij.ide.plugins.cl.PluginClassLoader @3e963f49 of the current class, org/slf4j/LoggerFactory, and the class loader com.intellij.ide.plugins.cl.PluginClassLoader @bc0817 for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature (org.slf4j.LoggerFactory is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @3e963f49, parent loader 'bootstrap'; org.slf4j.impl.StaticLoggerBinder is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @bc0817, parent loader 'bootstrap') [in thread "DefaultDispatcher-worker-50"]
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:423)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
	at com.bugsnag.Bugsnag.<clinit>(Bugsnag.java:27)
	at app.cash.sqldelight.intellij.SqlDelightErrorHandler.<init>(SqlDelightErrorHandler.kt:32)
	at com.intellij.serviceContainer.ComponentManagerImpl.findConstructorAndInstantiateClass(ComponentManagerImpl.kt:1383)
	at com.intellij.serviceContainer.ComponentManagerImpl.doInstantiateClass(ComponentManagerImpl.kt:1392)
	at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:1377)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.instantiateClass(XmlExtensionAdapter.kt:80)
	at com.intellij.openapi.extensions.impl.SimpleConstructorInjectionAdapter.instantiateClass(XmlExtensionAdapter.kt:100)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.doCreateInstance(XmlExtensionAdapter.kt:51)
	at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.kt:32)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:468)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:416)
	at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensionList(ExtensionPointImpl.java:249)
	at com.intellij.openapi.extensions.ExtensionPointName.getExtensionList(ExtensionPointName.kt:44)
	at com.intellij.diagnostic.IdeErrorsDialog$Companion.getSubmitter(IdeErrorsDialog.kt:1004)
	at com.intellij.diagnostic.IdeErrorsDialog$Companion.getSubmitter(IdeErrorsDialog.kt:997)
	at com.intellij.diagnostic.IdeErrorsDialog.getSubmitter(IdeErrorsDialog.kt)
	at com.intellij.diagnostic.DefaultIdeaErrorLogger.canHandle(DefaultIdeaErrorLogger.java:42)
	at com.intellij.diagnostic.DialogAppender.queueAppend(DialogAppender.java:83)
	at com.intellij.diagnostic.DialogAppender.publish(DialogAppender.java:58)
	at java.logging/java.util.logging.Logger.log(Logger.java:980)
	at java.logging/java.util.logging.Logger.doLog(Logger.java:1007)
	at java.logging/java.util.logging.Logger.log(Logger.java:1118)
	at com.intellij.idea.IdeaLogger.doLogError(IdeaLogger.java:169)
	at com.intellij.idea.IdeaLogger.error(IdeaLogger.java:145)
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:423)
	at com.intellij.openapi.application.impl.CoroutineExceptionHandlerImpl.handleException(CoroutineExceptionHandlerImpl.kt:34)
	at kotlinx.coroutines.internal.CoroutineExceptionHandlerImpl_commonKt.handleUncaughtCoroutineException(CoroutineExceptionHandlerImpl.common.kt:38)
	at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:32)
	at kotlinx.coroutines.StandaloneCoroutine.handleJobException(Builders.common.kt:194)
	at kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:231)
	at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath(JobSupport.kt:910)
	at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:867)
	at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:832)
	at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:100)
	at kotlinx.coroutines.debug.internal.DebugProbesImpl$CoroutineOwner.resumeWith(DebugProbesImpl.kt:549)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

aperfilyev added a commit to aperfilyev/sqldelight that referenced this issue Jan 25, 2024
aperfilyev added a commit to aperfilyev/sqldelight that referenced this issue Jan 25, 2024
aperfilyev added a commit to aperfilyev/sqldelight that referenced this issue Jan 25, 2024
@sergeys-opera
Copy link

Do you plan to release a new version any time soon? It would be good to unbreak the plugin.

@aperfilyev
Copy link
Collaborator

Do you plan to release a new version any time soon? It would be good to unbreak the plugin.

Use a snapshot!

@sergeys-opera
Copy link

sergeys-opera commented Mar 11, 2024

Isn't this Android Studio's (IDEA) plugin error and not Gradle's? Not sure I want to install Android Studio's plugins manually.

AlecKazakova pushed a commit to aperfilyev/sqldelight that referenced this issue Apr 5, 2024
AlecKazakova added a commit that referenced this issue Apr 5, 2024
* Bump intellij version

also closes #4894 and #4741

* Bump sql psi version

* Fixing up errors

* Include sql psi environment for tests

---------

Co-authored-by: Alec Kazakova <aleckazakova@squareup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants