Legacy Knowledge Base
Published Jul. 2, 2025

SAML Plugin

Written By

Pooja Bhambani

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

NOTE: This article is an INTERNAL article and is not visible to customers, currently. Please only link this article in internal comments, but not public comments.

Issue

  • After deploying the SAML plugin( saml-opensaml-integration 3.0.30) in the server. The run-time errors are coming. Though, the build & deployment is successful.
  • Steps to reproduce:
    1. Download the SAML source code(v5.0.1) saml-opensaml-integration 3.0.30 from the marketplace.
    2. Do some small changes in the build.gradle file (Because it's compileOnly dependency directly from the project. So, we've changed into the same version that we have in the LPKG file).
    3. Build & Deploy the created project.
    4. Deployment is successful.
    5. Deploy the jar file to the running server.
    6. After deploying, NoClassDefFoundError errors are thrown.

Environment

  • Liferay DXP 7.2
  • SAML Version 5.0.1

Resolution

  • In order to resolve the NoClassDefFoundError, the following lines must be changed in the build.gradle file.
    compileOnly project(":apps:portal-security:portal-security-export-import-api")
           compileOnly project(":apps:static:osgi:osgi-util")
           compileOnly project(":apps:static:portal-configuration:portal-configuration-metatype-api")
           compileOnly project(":core:osgi-service-tracker-collections")
           compileOnly project(":core:petra:petra-string")
           compileOnly project(":dxp:apps:saml:saml-api")
           compileOnly project(":dxp:apps:saml:saml-persistence-api")
    

    Replace the above compileOnly project dependencies with the below CompileOnly group dependencies.

    compileOnly group: "com.liferay", name: "com.liferay.portal.security.exportimport.api", version: "4.0.3"
    compileOnly group: "com.liferay", name: "com.liferay.osgi.util", version: "5.1.0"
    compileOnly group: "com.liferay", name: "com.liferay.portal.configuration.metatype.api", version: "2.0.13"
    compileOnly group: "com.liferay", name: "com.liferay.osgi.service.tracker.collections", version: "4.0.0"
    compileOnly group: "com.liferay", name: "com.liferay.petra.string", version: "3.0.3"
    compileOnly group: "com.liferay", name: "com.liferay.saml.api", version: "3.0.15"
    compileOnly group: "com.liferay", name: "com.liferay.saml.persistence.api", version: "3.0.14"
  • Also, in the jar built, the Import-Package header is completely missing from the MANIFEST.MF file. So, need to add the following lines in bnd.bnd file.
    Import-Package:\
    aQute.bnd.annotation.metatype;version="[1.45,2)",com.liferay.document.library.kernel.exception;version="[2.0,3)",com.liferay.document.library.kernel.store;version="[1.2,2)",com.liferay.expando.kernel.model;version="[2.1,3)",com.liferay.osgi.service.tracker.collections.map;version="[2.0,3)",com.liferay.petra.string;version="[1.4,2)",com.liferay.portal.configuration.metatype.annotations;version="[1.3,2)",com.liferay.portal.configuration.metatype.bnd.util;version="[2.0,3)",com.liferay.portal.kernel.bean;version="[7.1,8)",com.liferay.portal.kernel.configuration;version="[6.3,7)",com.liferay.portal.kernel.exception;version="[8.3,9)",com.liferay.portal.kernel.io.unsync;version="[6.2,7)",com.liferay.portal.kernel.json;version="[8.6,9)",com.liferay.portal.kernel.log;version="[7.0,8)",com.liferay.portal.kernel.model;version="[3.0,4)",com.liferay.portal.kernel.security;version="[6.2,7)",com.liferay.portal.kernel.security.auth;version="[2.2,3)",com.liferay.portal.kernel.service;version="[2.8,3)",com.liferay.portal.kernel.theme;version="[2.1,3)",com.liferay.portal.kernel.util;version="[9.19,10)",com.liferay.portal.security.exportimport;version="[1.0,2)",com.liferay.saml.persistence.exception;version="[1.0,2)",com.liferay.saml.persistence.model;version="[2.0,3)",com.liferay.saml.persistence.service;version="[2.0,3)",com.liferay.saml.runtime;version="[1.0,2)",com.liferay.saml.runtime.certificate;version="[1.0,2)",com.liferay.saml.runtime.configuration;version="[2.0,3)",com.liferay.saml.runtime.credential;version="[1.0,2)",com.liferay.saml.runtime.exception;version="[1.0,2)",com.liferay.saml.runtime.metadata;version="[2.0,3)",com.liferay.saml.runtime.servlet.profile;version="[1.0,2)",com.liferay.saml.util;version="[2.1,3)",javax.crypto,javax.crypto.interfaces,javax.crypto.spec,javax.json,javax.json.stream,javax.management,javax.naming,javax.naming.directory,javax.naming.ldap,javax.net,javax.net.ssl,javax.persistence,javax.script,javax.security.auth.callback,javax.security.auth.x500,javax.security.cert,javax.servlet,javax.servlet.http,javax.sql,javax.swing,javax.swing.border,javax.swing.event,javax.swing.text,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.namespace,javax.xml.parsers,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stream,javax.xml.validation,javax.xml.xpath,org.apache.commons.httpclient.params,org.apache.commons.httpclient.protocol,org.apache.commons.logging,org.apache.log4j,org.ietf.jgss,org.jdom,org.jdom.input,org.jdom.output,org.osgi.framework;version="[1.8,2)",org.osgi.framework.wiring;version="[1.2,2)",org.slf4j,org.w3c.dom,org.w3c.dom.events,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.traversal,org.w3c.dom.views,org.w3c.dom.xpath,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers,sun.misc,\
    	!bsh,\
    	\
    	!com.beust.jcommander.*,\
    	\
    	!com.google.common.*,\
    	!com.google.errorprone.*,\
    	\
    	!com.sun.*,\
    	\
    	!com.swabunga.*,\
    	\
    	!com.werken.*,\
    	\
    	!javax.annotation.*,\
    	\
    	!net.fortuna.*,\
    	\
    	!net.jcip.*,\
    	\
    	!net.sf.ehcache,\
    	\
    	!net.shibboleth.utilities.java.support.annotation.*,\
    	\
    	!net.spy.memcached.*,\
    	\
    	!nu.xom,\
    	\
    	!org.apache.axis.*,\
    	!org.apache.commons.configuration,\
    	!org.apache.commons.ssl,\
    	!org.apache.log.*,\
    	!org.apache.oro.*,\
    	!org.apache.poi.*,\
    	!org.apache.tools.ant.*,\
    	!org.apache.avalon.framework.logger.*,\	
    	\
    	!org.checkerframework.*,\
    	\
    	!org.joda.convert,\
    	\
    	!org.ldaptive.*,\
    	\
    	!org.owasp.validator.html,\
    	\
    	!org.relaxng.datatype.*,\
    	\
    	!sun.io,\
    	\
    	*

Additional Information

  • It's recommended that when customizing the existing lpkg file which is already present on the server. Then, the customized lpkg file must be overridden and renamed for overcoming the issue of the conflict.
  • Additionally, private source codes are not available for customers on GitHub. They can contact the support team and ask for the source. Also, according to the source code availability policy, we do not give the build script with the source.
  • Overriding lpkg Files
  • Private modules source code availability policy
Did this article resolve your issue ?

Legacy Knowledge Base