Additional JVM parameters seem to do the trick as mentioned on the sites below
https://kitmenke.com/blog/2017/08/05/classcastexception-submitting-spark-apps-to-hdinsight/
Ok, it looks like I nailed this one. When looking at the additional JVM parameters:
-Djavax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
I started to search in Eclipse to see where these are implemented. Using the option ctrl-shift-t to find a type in my project I did find both DocumentBuilderFactoryImpl and SAXParserFactoryImpl were implemented in the jdk.1.8.0_144. But also in respectively xml-apis.jar and xercesImpl-2.11.0.jar.
I removed both these JAR files from my userlib and for now my error message is gone! I will be checking the rest of my application but so far so good!