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

Dubbo Filters Failing to Load in Spring Boot Maven Plugin Versions 1.3.8.RELEASE or earlier #13623

Open
steverao opened this issue Mar 31, 2025 · 0 comments
Labels
bug Something isn't working needs triage New issue that requires triage

Comments

@steverao
Copy link
Contributor

steverao commented Mar 31, 2025

Describe the bug

A specific issue occurs when using Spring Boot Maven Plugin 1.3.8.RELEASE or earlier with Dubbo, where SPI-based filters like OpenTelemetryServerFilter fail to load. This is caused by an incompatibility in the LaunchedURLClassLoader implementation of older Spring Boot versions.
Problem Analysis:
The issue arises due to the way resources are loaded via SPI (Service Provider Interface) in Dubbo. Here's the breakdown:

  1. SPI Registration:
    The OpenTelemetry filters are registered via SPI in the file:
    META-INF/org.apache.dubbo.rpc.Filter.
    This is managed by the instrumentation module here:
    DubboInstrumentationModule.java#L32-L36.
  2. Resource Injection:
    The Javaagent instruments ClassLoader.getResources() to inject these resources:
    ResourceInjectionInstrumentation.java#L80-L113.
  3. Resource Lookup Failure:
    In Spring Boot Maven Plugin 1.3.8.RELEASE or earlier, the LaunchedURLClassLoader overrides getResource() in a way that skips the parent classloader (AppClassLoader):
    Faulty Code:
    LaunchedURLClassLoader.java#L71-L77.
    Line 74 explicitly avoids delegating to the parent, which breaks the expected resource lookup path.
    Fix:
    The Spring team resolved this in Spring Boot 1.4.x by ensuring parent classloaders are properly queried.
    Commit Fix.

Steps to reproduce

  1. Use spring-boot-maven-plugin 1.3.8.RELEASE or earlier to produce a jar of Dubbo's demo.
  2. We can see related filters cannot be loaded.

Expected behavior

Use spring-boot-maven-plugin 1.3.8.RELEASE or earlier to produce a jar of Dubbo's demo, Dubbo’s related filters can be loaded successfully.

Actual behavior

Use spring-boot-maven-plugin 1.3.8.RELEASE or earlier to produce a jar of Dubbo's demo, we can see related filters cannot be loaded.

Javaagent or library instrumentation version

2.14.0

Environment

JDK: JDK 1.8
OS: Linux

Additional context

Workaround: Upgrade to Spring Boot Maven Plugin 1.4.x or later.

@steverao steverao added bug Something isn't working needs triage New issue that requires triage labels Mar 31, 2025
@steverao steverao changed the title Dubbo‘s filters cannot be loaded when use spring-boot-maven-plugin 1.3.8.RELEASE and before Dubbo Filters Failing to Load in Spring Boot Maven Plugin Versions 1.3.8.RELEASE or earlier Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

1 participant