apache / apache/shenyu

[BUG] Plugin inner classes ($ entries) cannot be resolved by the plugin classloader

Open
#6,728 1 comment 0 reactions 0 assignees View on GitHub
priority: medium type: bug
Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
7d 1h
Merged PRs (30d)
85

Description

- Severity: Medium
- Location:
`shenyu-web/src/main/java/org/apache/shenyu/web/loader/PluginJarParser.java:66` (`!entryName.contains("$")`); `shenyu-web/src/main/java/org/apache/shenyu/web/loader/ShenyuPluginClassLoader.java:118-139` (`findClass`)
-
Description:
`parseJar` excludes any entry containing `$` from `clazzMap` and stores it in `resourceMap`. `findClass` only consults `classCache` and `clazzMap`; it never reads `resourceMap`. So `Outer$Inner` is unfindable: `ability("Outer$Inner")` returns true → delegates to `getParent().loadClass(...)` → app classloader cannot see plugin classes → `ClassNotFoundException`.
-
Impact:
Any uploaded/ext plugin referencing a nested/inner class (Builder pattern, nested enums, synthetic accessors) throws `NoClassDefFoundError` on first use at runtime; the plugin effectively can't use inner classes.
-
Suggested fix:
Put `$`-bearing `.class` entries into `clazzMap` too, or have `findClass` fall back to `resourceMap` for names containing `$`.
-
Confidence: Medium
- Related existing: none

---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with PluginJarParser.java:66 and ShenyuPluginClassLoader.java:118-139, then trace how plugin class entries move between clazzMap, resourceMap, and classCache. Verify the behavior with a plugin containing an Outer$Inner class. Done means the nested class resolves through the plugin classloader without delegating unsuccessfully to the application classloader.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.