fix: add SLF4J NOP binding to target, clean up stale imports#1280
fix: add SLF4J NOP binding to target, clean up stale imports#1280joaodinissf wants to merge 1 commit intodsldevkit:masterfrom
Conversation
|
@KrisLimbo , can you check this does not introduce again the warning in the builds of our other project? |
3ca0f0e to
ea0f764
Compare
ea0f764 to
fe53424
Compare
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| <?pde version="3.8"?> | ||
| <target name="DDK Target" sequenceNumber="25"> | ||
| <locations> |
There was a problem hiding this comment.
can you keep the line endings of this file?
There was a problem hiding this comment.
This was a formatting fix, not line endings. But happy to do it separately.
I likely won't have enough bandwidth to finish this today, but I'll get to it as soon as I get a chance.
There was a problem hiding this comment.
I realized yesterday evening we may want to do this slightly differently. I'll convert this to draft for now, and move to ready once you can have a look.
fe53424 to
607b20f
Compare
5c66da9 to
c8067bb
Compare
Add slf4j.nop 2.0.17 from Eclipse Orbit aggregation 4.39.0 to the DDK target platform. This makes the SLF4J NOP binding available to the OSGi runtime, though due to classloader isolation in OSGi the startup warning cannot be fully suppressed — slf4j.nop is a standalone bundle (not a fragment of slf4j.api), so ServiceLoader-based provider discovery does not find it before SLF4J's first initialization. This is a known limitation shared by Eclipse Platform itself. References: - qos-ch/slf4j#427 - https://github.com/orgs/eclipse-orbit/discussions/24 Also removes unused Import-Package: org.slf4j from three test bundle manifests where no source file references org.slf4j: - com.avaloq.tools.ddk.check.ui.test - com.avaloq.tools.ddk.xtext.test - com.avaloq.tools.ddk.xtext.test.core Retains org.slf4j in com.avaloq.tools.ddk.test.ui — its SwtBot wrapper classes directly use org.slf4j.Logger. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c8067bb to
f086983
Compare
Investigation: SLF4J warning in OSGi — Claude Code analysisBackgroundThis PR adds (On current master, the equivalent warning is Root causeSLF4J 2.x discovers providers via What was tried
Why this can't be fully fixedThe only way to fully suppress the warning would be packaging Eclipse Platform itself has the same limitation. Their approach (eclipse-platform/eclipse.platform.releng.aggregator#1094) configures start levels in DecisionThe SPI Fly config was removed from this PR since it adds complexity without suppressing the warning. The pragmatic approach is to keep References
🤖 Investigation performed with Claude Code |
Follow-up: downstream product configurationSince DDK plugins are assembled into an Eclipse RCP application downstream, the <plugin id="org.apache.aries.spifly.dynamic.bundle" autoStart="true" startLevel="2" />
<plugin id="slf4j.nop" autoStart="true" startLevel="2" />This ensures SPI Fly (the OSGi Service Loader Mediator) starts early enough to wire The warning that remains in CI is specific to Tycho Surefire's test runtime, which spins up its own Equinox instance without a |
Alternative: suppress warning via SLF4J system propertyPR #1299 (stacked on this one) adds This is a pragmatic complement to the target platform change in this PR. For downstream RCP products, the proper fix remains configuring SPI Fly + |
What
Add
slf4j.nop2.0.17 to the DDK target platform (from the Eclipse Orbit aggregation repository already used for other dependencies).Also removes unused
Import-Package: org.slf4jfrom 3 test bundle manifests where no source file referencesorg.slf4j:com.avaloq.tools.ddk.check.ui.testcom.avaloq.tools.ddk.xtext.testcom.avaloq.tools.ddk.xtext.test.coreRetains
org.slf4jincom.avaloq.tools.ddk.test.ui— its SwtBot wrapper classes directly useorg.slf4j.Logger.Why
The SLF4J NOP binding should be available to the OSGi runtime. However, due to classloader isolation in OSGi, the startup warning (
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"on 1.7.x orSLF4J(W): No SLF4J providers were foundon 2.x) cannot be fully suppressed —slf4j.nopis a standalone bundle, not a fragment ofslf4j.api, soServiceLoader-based provider discovery does not find it before SLF4J's first initialization. This is a known limitation shared by Eclipse Platform itself.References