I have fixed several issues with the sample code and it is now working for me. I ended up creating a fresh spring boot application from https://start.spring.io/
Issue 1:
The @SprintBootApplication annotation in the main application file did not seem to be scanning the java package for other classes marked with @Component and @Xbox One X etc. To fix I had to also add e.g. @ComponentScan("org.example.msal4jsample")
Use the package name for your project.
Issue 2:
The @RequestMapping annotations on the routes in the PageController file are incorrect and I had to shorten them to just "/", "/secure/aad", "/sign_out", "/graph/me"
Issue 3:
An exception occurs as posted above from the AuthFilter class since it implements javax.servlet.FIlter. I had to add the following lines to correct:
@Override
public void init(FilterConfig config) {}
@Override
public void destroy() {}
Issue 4:
In the getAuthResulteByAuthCode function in the AuthHelper class -> the URI passed in parameters to acquireToken must have the full redirectUriSignin from config rather that the currentUri passed from the AuthFilter class.