Skip to content

Missing hints for WebMvcTypeExcludeFilter #32420

@snicoll

Description

@snicoll

Trying to run a WebMvcTest in a native image leads to:

Failures (1):
  JUnit Jupiter:DemoControllerTests
    ClassSource [className = 'com.example.demo.DemoControllerTests', filePosition = null]
    => java.lang.IllegalStateException: Unable to create filter for class org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTypeExcludeFilter
       org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizer.instantiateTypeExcludeFilter(TypeExcludeFiltersContextCustomizer.java:68)
       org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizer.instantiateTypeExcludeFilters(TypeExcludeFiltersContextCustomizer.java:53)
       org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizer.<init>(TypeExcludeFiltersContextCustomizer.java:46)
       org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizerFactory.createContextCustomizer(TypeExcludeFiltersContextCustomizerFactory.java:57)
       org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizerFactory.createContextCustomizer(TypeExcludeFiltersContextCustomizerFactory.java:51)
       [...]
     Caused by: java.lang.NoSuchMethodException: org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTypeExcludeFilter.<init>()
       java.lang.Class.getConstructor0(DynamicHub.java:3585)
       java.lang.Class.getDeclaredConstructor(DynamicHub.java:2754)
       org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizer.getTypeExcludeFilterConstructor(TypeExcludeFiltersContextCustomizer.java:113)
       org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizer.instantiateTypeExcludeFilter(TypeExcludeFiltersContextCustomizer.java:60)
       [...]

Perhaps an inference on TypeExcludeFilters is missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by anothertheme: aotAn issue related to Ahead-of-time processingtype: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions