Skip to content

Auto-configure not working when using @SpringBootApplication #777

@echoesbr

Description

@echoesbr

Description

The library is not initialised when using the annotation @SpringBootApplication(exclude = ErrorMvcAutoConfiguration.class)

Expected Behavior

The expected behaviour should be the default error response from the library.

Actual Behavior

The default Spring boot response is returned (empty).

Steps to Reproduce

  1. Added library
    <dependency> <groupId>org.zalando</groupId> <artifactId>problem-spring-web-starter</artifactId> <version>0.27.0</version> </dependency>

  2. Configure Spring boot
    web: resources: add-mappings: false mvc: throw-exception-if-no-handler-found: true

  3. Used annotation
    @SpringBootApplication(exclude = ErrorMvcAutoConfiguration.class)

  4. Alternatively tried with following without success
    @EnableAutoConfiguration(exclude = {ErrorMvcAutoConfiguration.class}) @Configuration @ComponentScan(basePackages = "com.foo.bar") @SpringBootConfiguration

Your Environment

  • Version used: 0.27.0
  • Spring Boot version: 2.6.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions