Brijendra Jaiswal

Greenhorn
+ Follow
since Dec 06, 2018
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Brijendra Jaiswal

Hi Team,

I am implementing SpringSecurity but while using below class implementation facing below error.   Can we use xyzUser table instead of User
 
Getting Error : PropertyReferenceException: No property findbyusername found for type  



public class CustomUserDetailsService implements UserDetailsService {

   @Autowired
   private pdmUserRepository repository;

   @Override
   public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
       xyzUser user = repository.findbyusername(username);
        System.out.println("UserName :"+ user);
        //CustomUserDetails userDetails = null;
       if(user.isPresent())
       {
           return user.get();
           // userDetails = new CustomUserDetails();
           // userDetails.setUser(user);
       }else{
           throw new UsernameNotFoundException("User not exist with name :"+ username);
       }
       return null;
   }
}

1 week ago