Mx4 to 5 java.lang.LinkageError for javax/servlet/http/HttpServletResponse

1
I'm getting a red-line error in my console, when I use this IMxRuntimeRequest.getHttpServletRequest. In Mendix 4 we used the deprecated method getOriginalRequest to get the original request, but now get an error in Mendix 5: ERROR - Connector: java.lang.ClassCastException: org.eclipse.jetty.server.Request cannot be cast to javax.servlet.http.HttpServletRequest using: (HttpServletRequest) runtimeRequest.getOriginalRequest() I then changed the method to getHttpServletRequest as such: runtimeRequest.getHttpServletRequest() and now it redlines: An unhandled error occurred in the MxRuntime. java.lang.LinkageError: loader constraint violation: when resolving interface method "com.mendix.m2ee.api.IMxRuntimeResponse.getHttpServletResponse()Ljavax/servlet/http/HttpServletResponse;" the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) of the current class, kerberossso/custom/KerberosSSORequestHandler, and the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) for resolved class, com/mendix/m2ee/api/IMxRuntimeResponse, have different Class objects for the type javax/servlet/http/HttpServletResponse; used in the signature Because its mentioning felix, I'm assuming its the way resources are being packaged for Mendix' OSGI framework, which from the use of the m2ee api is a little bit of black magic to me still. Is this something I should log a ticket for? This is pretty important for our Kerberos SSO and critical to an upgrade of Mendix [Update] I tried casting runtimeRequest.getOriginalRequest() to org.eclipse.jetty.server.Request after including the Jetty jars in the bundles folder of Mendix, now I'm getting: java.lang.ClassCastException: org.eclipse.jetty.server.Request cannot be cast to org.eclipse.jetty.server.Request Thats very odd, I can't cast org.eclipse.jetty.server.Request to org.eclipse.jetty.server.Request. So, I'm stuck at: java.lang.LinkageError: loader constraint violation: when resolving interface method "com.mendix.m2ee.api.IMxRuntimeResponse.getHttpServletResponse()Ljavax/servlet/http/HttpServletResponse;" the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) of the current class, kerberossso/custom/KerberosSSORequestHandler, and the class loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) for resolved class, com/mendix/m2ee/api/IMxRuntimeResponse, have different Class objects for the type javax/servlet/http/HttpServletResponse; used in the signature
asked
1 answers
2

See: https://world.mendix.com/display/refguide5/Troubleshooting

Remove servlet-api.jar from your userlib.

answered