Skip to content

Fix DefaultVFS listing .class files as resources#3691

Open
EvanYao826 wants to merge 1 commit into
mybatis:masterfrom
EvanYao826:fix/default-vfs-class-file-parsing
Open

Fix DefaultVFS listing .class files as resources#3691
EvanYao826 wants to merge 1 commit into
mybatis:masterfrom
EvanYao826:fix/default-vfs-class-file-parsing

Conversation

@EvanYao826
Copy link
Copy Markdown

Fixes #3689

Problem

DefaultVFS.list() recursively processes .class files as resources, which causes IllegalArgumentException in Tomcat 9.0.118+ / 10.1.55+ due to improved resource path validation in StandardRoot.validate.

Fix

Added an early-return check at the beginning of DefaultVFS.list() to skip .class files, since they are not directories and cannot contain child resources.

Test

Added a unit test listShouldSkipClassFiles that verifies .class file URLs return an empty list.

DefaultVFS.list() recursively processes .class files as resources, which
causes IllegalArgumentException in Tomcat 9.0.118+ / 10.1.55+ due to
improved resource path validation (StandardRoot.validate normalizes
resource paths containing .class file content to null).

Added an early-return check at the beginning of the list() method to
skip .class files since they cannot contain child resources.

Fixes mybatis#3689
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.

DefaultVFS causes exception when parsing package resources in Tomcat 9.0.118 / 10.1.55

1 participant