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

fix: update dependencies to address exception when itly loads slf4j [HEAD-883] #456

Conversation

bastiandoetsch
Copy link
Collaborator

Description

Originally, I wanted to update the itly sdk to use amplitude sdk. Unfortunately, there does not seem to be an amplitude JVM sdk, the only one applicable would be the Android one, which is not compatible with non Android clients, it seems.

So I:

  • excluded org.slf4j from the plugin verifier dependency of Itly
  • defined a non-conflicting version 2.0.5 of org.slf4j.slf4j-api as implementation dependency, which should add it to the right classloaders.

This should fix the following 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 @3a1e0dd7 of the current class, org/slf4j/LoggerFactory, and the class loader com.intellij.ide.plugins.cl.PluginClassLoader @5ac37318 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 @3a1e0dd7, parent loader 'bootstrap'; org.slf4j.impl.StaticLoggerBinder is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @5ac37318, parent loader 'bootstrap')
	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.networknt.schema.JsonSchemaFactory.<clinit>(JsonSchemaFactory.java:39)
	at ly.iterative.itly.SchemaValidatorPlugin.load(SchemaValidatorPlugin.kt:24)
	at ly.iterative.itly.core.Itly$load$2.invoke(Itly.kt:62)
	at ly.iterative.itly.core.Itly$load$2.invoke(Itly.kt:6)
	at ly.iterative.itly.core.Itly.runOnAllPlugins(Itly.kt:160)
	at ly.iterative.itly.core.Itly.runOnAllPlugins$default(Itly.kt:157)
	at ly.iterative.itly.core.Itly.load(Itly.kt:62)
	at ly.iterative.itly.core.Itly.load(Itly.kt:34)
	at snyk.analytics.Itly.load(Itly.java:71)
	at io.snyk.plugin.analytics.Iteratively.<clinit>(Iteratively.kt:43)
	at io.snyk.plugin.services.SnykAnalyticsService.<init>(SnykAnalyticsService.kt:32)
	at com.intellij.serviceContainer.ComponentManagerImpl.doInstantiateClass(ComponentManagerImpl.kt:962)
	... 20 more

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

Screenshots / GIFs

Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!

@bastiandoetsch bastiandoetsch requested a review from a team as a code owner October 11, 2023 09:19
Copy link
Contributor

@cat2608 cat2608 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔝

@bastiandoetsch bastiandoetsch merged commit df73e35 into master Oct 11, 2023
8 checks passed
@bastiandoetsch bastiandoetsch deleted the fix/HEAD-883_update-dependency-declaration-to-fix-exception branch October 11, 2023 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants