SAML configuration

0
Good Afternoon,Trying to configure SAML in one of our apps. This is an upgrade from 7 to 9 - getting an error when pressing Save on the SP Configuration tab. This is the error message:An error occured while updating the configuration:class org.opensaml.soap.soap11.impl.BodyBuilder cannot be cast to class org.opensaml.xml.XMLObjectBuilder (org.opensaml.soap.soap11.impl.BodyBuilder and org.opensaml.xml.XMLObjectBuilder are in unnamed module of loader com.mendix.container.deployment.internal.Interpreters$ClassLoaders$$anon$1 @5d12a356)Can anyone help guide me to fix it please?I have tried downloading the SAML module again but then causing compilation errors when trying to run the app.Thanks
asked
5 answers
0

This error usually happens because of conflicting or outdated JAR files after upgrading a Mendix project (for example from 7 to 9). In this case different versions of the OpenSAML libraries are loaded, which causes the class cast error you are seeing.


The first thing to check is the userlib and vendorlib folders in your project. Look for OpenSAML related JARs such as opensaml, xmltooling, or xmlsec. If you see duplicate or older versions, remove them.


The safest way to resolve this is to clean up the dependencies and reinstall the related modules. Remove the JAR files that belong to modules like SAML20, MxModelReflection, and CommunityCommons from the userlib/vendorlibfolders. After that, install these modules again from the Mendix Marketplace so the correct dependencies are restored.


Finally, do a Clean Deployment Directory and run the application again.


This usually resolves the OpenSAML class conflict that appears after upgrading older Mendix projects.



If this solves your issue, please mark the answer as accepted.


answered
0

I deleted all the Jar files associated with SAML and Community commons - it doesn't look like MxReflection has any - I did it based on the Jar files that appeared when downloading the 3 modules onto a new application. I then redownloaded them all. I cleaned the deployment directory - details below - If you know what to do from here? I went back in and deleted an duplicates but still have the compilation errors.


If you have any idea from here?


Thanks for you help.


answered
0

Hi Jessica


I had this problem a lot of time, I used to remove all the duplicate jars manually or else i remove all the jars which is imported from SAML and commons and then install them again from marketplace, it will solve the problem.


May be I will cross my finger to work for you.

answered
0

Hi,


This error usually happens because of a dependency conflict with the OpenSAML libraries after upgrading the application. When moving from Mendix 7 to Mendix 9, the SAML module and its bundled libraries must match the Mendix runtime version. If older SAML module files or conflicting JARs remain in the project, you can get errors like:

BodyBuilder cannot be cast to XMLObjectBuilder

This is typically caused by multiple OpenSAML versions being loaded at runtime.

The safest way to resolve it is to clean the SAML module and its dependencies completely and reinstall it:

  1. Remove the existing SAML module from the project.
  2. Delete all related JAR files from the userlib folder (especially OpenSAML, xmlsec, and related libraries).
  3. Download the latest SAML module version compatible with Mendix 9 from the Mendix Marketplace.
  4. Import the module again and let Mendix restore the correct dependencies.
  5. Run Project → Clean Deployment Directory and start the application again.

Also make sure there are no other modules bringing their own OpenSAML libraries, because that can cause the same class-loader conflict.

In most upgrade scenarios from Mendix 7 → 9, simply reinstalling the SAML module and cleaning the deployment directory resolves this issue because it removes the conflicting OpenSAML versions.


answered
0

Thank you to everyone who responded.

I ended up deleting everthing in the userlib folder and downloading each marketplace module again. It now runs and I can saves on the SP Configuration. When I press the download, the file that downloads is all gibberish, which I don't think is correct.



Example of the gibberish.





I believe it needs to be an XML file.


Does anyone know what I need to do now please?

Thanks in advance


Jess

answered