Reputation: 592
As you know @AuthenticationPrincipal in web.bind.annotation.AuthenticationPrincipal is depreacted . It is recommended to use core.annotation.AuthenticationPrincipal. So we have changed import statements as core.annotation.AuthenticationPrincipal and now we are getting below error :
org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.xxx.xxx.authentication.OurUserDetailsImpl]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.xxx.xxx.authentication.OurUserDetailsImpl.<init>()
Are there any known problem related with this annotation ? P.S we are using parameterized constructor and we dont have a default constructor so I am aware of this. Many thanks.
Upvotes: 2
Views: 2878
Reputation: 21730
Make sure you are using org.springframework.security.web.method.annotation.AuthenticationPrincipalArgumentResolver
as apposed to org.springframework.security.web.bind.support.AuthenticationPrincipalArgumentResolver
.
UPDATE I created #3771 to track making this easier to follow in the documentation.
Upvotes: 5