Error running a restful API service (on premise)

1
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(BundleWiringImpl.java:2279)  at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)  at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)  at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)  at java.lang.ClassLoader.loadClass(Unknown Source)  at restservices.publish.RestServiceHandler.processRequest(RestServiceHandler.java:257)  at com.mendix.externalinterface.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:69)  at com.mendix.externalinterface.connector.MxRuntimeConnector$1.execute(MxRuntimeConnector.java:66)  at com.mendix.util.classloading.Runner.doRunUsingClassLoaderOf(Runner.java:32)  at com.mendix.externalinterface.connector.MxRuntimeConnector.processRequest(MxRuntimeConnector.java:72)  at com.mendix.core.impl.MxRuntimeImpl.processRequest(MxRuntimeImpl.java:741)  at com.mendix.m2ee.appcontainer.server.handler.RuntimeHandler.handle(RuntimeHandler.java:41)  at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:52)  at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)  at org.eclipse.jetty.server.Server.handle(Server.java:368)  at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)  at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953)  at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014)  at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)  at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)  at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)  at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)  at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)  at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)  at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)  at java.lang.Thread.run(Unknown Source)  
asked
2 answers
5
  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
answered
0

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

answered