[2/24/20 12:20:41:747 EAT] 00000075 SystemErr R Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: Unable to start web server; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'webSecurityConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userDetailsServiceImpl': Unsatisfied dependency expressed through field 'userRepo'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepo': Post-processing of merged bean definition failed; nested exception is java.lang.NoSuchMethodError: javax/persistence/PersistenceContext.synchronization()Ljavax/persistence/SynchronizationType; (loaded from file:/C:/Program Files (x86)/IBM/WebSphere/AppServer/plugins/javax.j2ee.persistence.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@cdc1acc9) called from class org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement (loaded from file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/myserverNode01Cell/mcomm-0_0_1-SNAPSHOT_war.ear/mcomm-0.0.1-SNAPSHOT.war/WEB-INF/lib/spring-orm-5.2.1.RELEASE.jar by com.ibm.ws.classloader.CompoundClassLoader@e9512a60[war:mcomm-0_0_1-SNAPSHOT_war/mcomm-0.0.1-SNAPSHOT.war]
My Repository
public interface UserRepo extends JpaRepository{
User findByUsername(String username);
List<User> findByApprovedAndDeletedAndDeleteApproved(Boolean approved,Boolean deleted,Boolean deleteapproved);
List<User> findByDeletedAndDeleteApproved(Boolean deleted,Boolean deleteapproved);
@Procedure
public void ADD_PASSWORD_HISTORY(Long id, String passwd);
@Procedure
public int SP_CHECK_PASS_REUSE(Long usrid, String passwd);
@Procedure
public void UN_EDIT_PASSWORD(Long id);
}
My Service
@Service public class UserDetailsServiceImpl implements UserDetailsService {
@Autowired
private UserRepo userRepo=null;
public UserDetails loadUserByUsername(String username){
User user = userRepo.findByUsername(username);
if(user==null){
throw new UsernameNotFoundException("Username not found");
}
return new org.springframework.security.core.userdetails.User(user.getUsername(),user.getPassword(),
true,true,true,true,getGrantedAuthorities(user));
}
private List<GrantedAuthority> getGrantedAuthorities(User user){
List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
for(GrantedAuthority roles : user.getAuthorities()){
authorities.add(new SimpleGrantedAuthority(((Role) roles).getName()));
}
return authorities;
}
}