The 'Application.java' class definition is repeated with no difference between the two; so the second one is unnecessary.
The 'WebSecurityConfig.java' class has incorrect annotations used, which are now deprecated. The annotations below the code(i.e. in the description) are correct, but in the code are wrong.
The 'Authenticating a User with LDAP' guide - https://spring.io/guides/gs/authenticating-ldap/ has some errors that need to be corrected:
Wrong import: import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
Correct import: import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
Also the annotation 'EnableWebMvcSecurity' on line 11 needs to be changed accordingly.