Error running a restful API service (on premise)

We are getting this frustrating error when trying to implement a Restful API service. We definitely know it is a conflict and it is buried in a jar file (probably one of the Felix bundles).  What we don't know is whether there is an easy way to resolve the conflict, without inspecting each jar file manually to find the conflict by hand. Anyone know how to resolve this problem? java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "javax/servlet/http/HttpServletRequest"  at java.lang.ClassLoader.defineClass1(Native Method)  at java.lang.ClassLoader.defineClass(Unknown Source)  at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(  at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(  at org.apache.felix.framework.BundleWiringImpl.access$400(  at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(  at java.lang.ClassLoader.loadClass(Unknown Source)  at restservices.publish.RestServiceHandler.processRequest(  at com.mendix.externalinterface.connector.MxRuntimeConnector$1.execute(  at com.mendix.externalinterface.connector.MxRuntimeConnector$1.execute(  at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(  at com.mendix.externalinterface.connector.MxRuntimeConnector.processRequest(  at com.mendix.core.impl.MxRuntimeImpl.processRequest(  at com.mendix.m2ee.appcontainer.server.handler.RuntimeHandler.handle(  at org.eclipse.jetty.server.handler.HandlerList.handle(  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(  at org.eclipse.jetty.server.Server.handle(  at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(  at org.eclipse.jetty.server.AbstractHttpConnection.content(  at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(  at org.eclipse.jetty.http.HttpParser.parseNext(  at org.eclipse.jetty.http.HttpParser.parseAvailable(  at org.eclipse.jetty.server.AsyncHttpConnection.handle(  at  at$  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(  at org.eclipse.jetty.util.thread.QueuedThreadPool$  at Source)  
2 answers
  1. Check the userlib directory for jar files with the same name and different version numbers.
  2. Check if any of the jar files is also loaded in the JRE version you are running.
  3. Clean userlib directory to remove unused files from previous module versions by
    1. Remove all jar files from userlib directory
    2. Store them somewhere else (backup)
    3. Start importing your appstore modules, this will add the necessary jar files to the userlib directory.
    4. import any custom jar files used by your custom java actions (if any)
    5. Try an run your project

If at all possible use this as an excuse to upgrade to 7.12 Rest services nowadays are so much more mature compared to 6.4