In my case, it was because I included a dependency (Apache Tika) in the POM.xml file.
I had to force the exclusion of the module that contained the classes with errors while imported at that dependency:
org.apache.tika
tika-parsers
1.24.1
xml-apis
xml-apis
It worked for me that way.