question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ProblemAuthenticationEntryPoint in spring-boot app

See original GitHub issue

Integrating the ProblemAuthenticationEntryPoint as described in the README leads to the following exception on starting a spring-boot application:

***************************
APPLICATION FAILED TO START
***************************

Description:

Field resolver in org.zalando.problem.spring.web.advice.security.ProblemAuthenticationEntryPoint required a single bean, but 2 were found:
        - errorAttributes: defined by method 'errorAttributes' in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration.class]
        - handlerExceptionResolver: defined by method 'handlerExceptionResolver' in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]


Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

Which one to pick?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kakawaitcommented, Oct 27, 2016

Using a qualifier is always more expressive and more importantly it’s safe against refactorings, especially accidental ones.

Maybe, but if we really want to be safe we should create kind of integration test against small Spring boot app

0reactions
whiskeysierracommented, Oct 27, 2016

Using a qualifier is always more expressive and more importantly it’s safe against refactorings, especially accidental ones.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring Boot/Spring Security AuthenticationEntryPoint not ...
This is my code to implement AuthenticationEntryPoint and AccessDeniedHandler with Spring Boot / JWT. I hope it will be of help to anyone....
Read more >
AuthenticationEntryPoint is not triggered on invalid bearer token
Describe the bug I have a Spring application that configures a custom AuthenticationEntryPoint (I add it simply to log authentication errors ...
Read more >
Spring Boot/Spring Security AuthenticationEntryPoint not ...
This is my code to implement AuthenticationEntryPoint and AccessDeniedHandler with Spring Boot / JWT. I hope it will be of help to anyone....
Read more >
Multiple Entry Points in Spring Security | Baeldung
In this quick tutorial, we're going to take a look at how to define multiple entry points in a Spring Security application.
Read more >
Servlet Authentication Architecture :: Spring Security
Request Credentials with AuthenticationEntryPoint - used for requesting credentials from a client (i.e. redirecting to a log in page, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found