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
keepAliveURLrelated records are missing in theexpandocolumntable. For reference: the defaultkeepAliveURLrecord 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:
- Shut down the server
- Delete the currently installed SAML jar file from
[Liferay_Home]/osgi/portal - Delete the Liferay cache folder:
[Liferay_Home]/osgi/state - Restart the server
- Redeploy the SAML jars
Steps in DXP 7.1:
- Shut down the server
- Delete the currently installed SAML LPKG file from
[Liferay_Home]/osgi/marketplace - Delete the
[Liferay_Home]/osgi/statefolder, clean the[Liferay_Home]/workfolder - Start the server
- Redeploy SAML LPKG
- 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.lpkgcan 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:
- Shut down all cluster nodes
- Delete the current installed SAML LPKG file from
[Liferay_Home]/osgi/marketplaceon both nodes - Delete the
[Liferay_Home]/osgi/statefolder, clean the[Liferay_Home]/workfolder on both nodes - Start node 1 and deploy SAML LPKG again
- 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.lpkgcan be observed in the log, restart node 1 - After node 1 is started correctly, check the database and see if the records exists in
expandocolumntable - Keep node 1 open, and repeat the above step 4-5 on the rest of the nodes.