November 28, 2020

Caused by: java.lang.IllegalArgumentException: Not a managed type: class com.amazon.datascience.model.admin.GoogleInterview on entity object

Caused by: java.lang.IllegalArgumentException: Not a managed type: class com.amazon.datascience.model.admin.GoogleInterview

This exception is mainly due to missing things in model class

November 21, 2020

org.springframework.security.authentication.InternalAuthenticationServiceException | UserDetailsService returned null

org.springframework.security.authentication.InternalAuthenticationServiceE

xception: UserDetailsService returned null, which is an interface contract 

violation\r\n\tat 

org.springframework.security.authentication.dao.DaoAuthenticationProvider

.retrieveUser(DaoAuthenticationProvider.java:110)\r\n\tat 

org.springframework.security.authentication.dao.AbstractUserDetailsAuthen

ticationProvider.authenticate

(AbstractUserDetailsAuthenticationProvider.java:144)\r\n\tat 

org.springframework.security.authentication.ProviderManager.authenticate

(ProviderManager.java:175)\r\n\tat 

org.springframework.security.authentication.ProviderManager.authenticate

(ProviderManager.java:195)


Solution

if your service class is implementing org.springframework.security.core.userdetails.UserDetailsService
you should implement loadUserByUsername()
and returns a new User(username,pass,rolesList)



public class yourServiceClass implements UserDetailsService {

//unimplemented method
loadUserByUsername(){
return new User(x,y,z);
}}

November 14, 2020

Auto Configuration in spring boot

Auto Configuration...


All auto configuration logic is executed in spring-boot-autoconfigure.jar. All auto configuration logic for MVC, JMS, data, and other frameworks is available in a JAR.

Auto-configuration @Conditional

If specific classes are offered in the classpath, then the configuration for that feature is enabled via auto configuration. Annotations such as @ConditionalOnMissingBean, @ConditionalOnClass, help in providing these functions.

Example 1
@Configuration
@ConditionalOnClass({ DataSource.class, EmbeddedDatabaseType.class })
@EnableConfigurationProperties(DataSourceProperties.class)
@Import({ Registrar.class, DataSourcePoolMetadataProvidersConfiguration.class })
public class DataSourceAutoConfiguration {
@ConditionalOnClass({ DataSource.class, EmbeddedDatabaseType.class })

This configuration is enabled only when the classes are present in the classpath.

November 07, 2020

The injection point has the following annotations: - @org.springframework.beans.factory.annotation.Autowired(required=true)

Errors and solution
=============

Description:

Field customAuthProvider in com.proximotech.zhw.WebServiceAuthProviderSecurityConfig required a bean of type 'com.proximotech.zhw.WebServiceAuthenticationProvider' that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.proximotech.zhw.WebServiceAuthenticationProvider' in your configuration.

Solution:
Annotation @component missing in the class
com.proximotech.zhw.WebServiceAuthenticationProvider

Facebook comments