Skip to content

Tag: spring

Factory pattern using generics

I would like to build a class that caches classes of type CachedObject using Map. Below is the factory class. I have a class that extends CacheableObject as below: When I try to create an instance of class X that extends CachedObject using the get method in the factory as below: (please note that cachedObjectFactory is autowired using Spring) I

BeanCreationException when creating Bean of type org.springframework.web.servlet.LocaleResolver

I’m trying to apply internationalization in a Spring Boot app by following some guide. For some reason, in the guide that I’m following it works but not on my local. I can’t figure out why. The error I am getting in console is : org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘localeResolver’ I am aware that when Spring creates a Bean,

spring security hasAuthority(“SCOPE_xxx”) method not working with spring authorization server version 0.2.0

I have created an authorization server using the new spring authorization server module. I am able to get the token successfully but when I try to use the token against a protected endpoint with hasAuthority() I get forbidden 403 error. Below my pom.xml file Below is my Authorization Server config And this is my Security Config Here is my user