Legacy Knowledge Base
Published Jul. 2, 2025

Unable to create IDP in SAML configuration with error “java.lang.RuntimeException: java.lang.NullPointerException”

Written By

Aaron Wang

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

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

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

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

Issue

  • Unable to create IDP in SAML configuration with error “java.lang.RuntimeException: java.lang.NullPointerException”
2021-01-08 18:31:29.437 DEBUG [default task-193][SamlAdminPortlet:74] java.lang.NullPointerException
java.lang.RuntimeException: java.lang.NullPointerException
at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.getAttributeType(ExpandoBridgeImpl.java:334)
at com.liferay.portal.util.PortalImpl.getExpandoBridgeAttributes(PortalImpl.java:2214)
at com.liferay.portal.util.PortalImpl.getExpandoBridgeAttributes(PortalImpl.java:2238)
at com.liferay.portal.kernel.util.PortalUtil.getExpandoBridgeAttributes(PortalUtil.java:936)
at com.liferay.portal.kernel.service.ServiceContextFactory.getInstance(ServiceContextFactory.java:510)

Environment

  • Liferay DXP 7.1
  • Liferay DXP Quarterly Release

Resolution

  • The root cause for this error is that the default keepAliveURL related records are missing in the expandocolumn table. For reference: the default keepAliveURLrecord should look like this in the database
35101 20099 34002 keepAliveURL 15 keepAliveURL 
35102 20099 34005 keepAliveURL 15 keepAliveURL
  • The issue can be resolved by redeploying SAML lpkg or jars. The missing records will be added back after redeploying SAML lpkg.

Steps in DXP Quarterly Release:

  1. Shut down the server
  2. Delete the currently installed SAML jar file from [Liferay_Home]/osgi/portal
  3. Delete the Liferay cache folder: [Liferay_Home]/osgi/state
  4. Restart the server
  5. Redeploy the SAML jars

 

Steps in DXP 7.1:

  1. Shut down the server
  2. Delete the currently installed SAML LPKG file from [Liferay_Home]/osgi/marketplace
  3. Delete the [Liferay_Home]/osgi/state folder, clean the [Liferay_Home]/work folder
  4. Start the server
  5. Redeploy SAML LPKG
  6. When the information like The portal instance needs to be restarted to complete the installation of file:/D:/Bundles/liferay-dxp-tomcat-7.1.10-ga1-20180703090613030/liferay-dxp-7.1.10-ga1/osgi/marketplace/Liferay%20Connector%20to%20SAML%202.0%20-%20API.lpkg can be observed in the log, restart the server to see if the record can be generated
  • If you are in a clustered environment, please check if SAML is properly deployed on each node. 

Steps for clustered DXP 7.1 environment:

  1. Shut down all cluster nodes
  2. Delete the current installed SAML LPKG file from [Liferay_Home]/osgi/marketplace on both nodes
  3. Delete the [Liferay_Home]/osgi/state folder, clean the [Liferay_Home]/work folder on both nodes
  4. Start node 1 and deploy SAML LPKG again
  5. When the information likeThe portal instance needs to be restarted to complete the installation of file:/D:/Bundles/liferay-dxp-tomcat-7.1.10-ga1-20180703090613030/liferay-dxp-7.1.10-ga1/osgi/marketplace/Liferay%20Connector%20to%20SAML%202.0%20-%20API.lpkg can be observed in the log, restart node 1
  6. After node 1 is started correctly, check the database and see if the records exists in expandocolumn table
  7. Keep node 1 open, and repeat the above step 4-5 on the rest of the nodes.
Did this article resolve your issue ?

Legacy Knowledge Base