Issue
- Users cannot be exported in some instances: the interface gets blank, and the following exception is thrown:
"2021-04-08T10:57:43.604+0200 ERROR [http-nio-8080-exec-25][ExportUsersMVCResourceCommand:100] java.lang.RuntimeException: java.lang.NullPointerException
java.lang.RuntimeException: java.lang.NullPointerException
at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.getAttribute(ExpandoBridgeImpl.java:218)
at com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl.getAttribute(ExpandoBridgeImpl.java:198)
at com.liferay.users.admin.web.portlet.action.ExportUsersMVCResourceCommand.getUserCSV(ExportUsersMVCResourceCommand.java:117)
at com.liferay.users.admin.web.portlet.action.ExportUsersMVCResourceCommand.getUsersCSV(ExportUsersMVCResourceCommand.java:257)
at com.liferay.users.admin.web.portlet.action.ExportUsersMVCResourceCommand.doServeResource(ExportUsersMVCResourceCommand.java:91)
at com.liferay.portal.kernel.portlet.bridges.mvc.BaseMVCResourceCommand.serveResource(BaseMVCResourceCommand.java:41)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.callResourceMethod(MVCPortlet.java:442)
at com.liferay.portal.kernel.portlet.LiferayPortlet.serveResource(LiferayPortlet.java:140)
.......................
.......................
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at com.liferay.portlet.expando.service.permission.ExpandoColumnPermissionImpl.contains(ExpandoColumnPermissionImpl.java:73)
at com.liferay.expando.kernel.service.permission.ExpandoColumnPermissionUtil.contains(ExpandoColumnPermissionUtil.java:58)
at com.liferay.portlet.expando.service.impl.ExpandoValueServiceImpl.getData(ExpandoValueServiceImpl.java:121)
at sun.reflect.GeneratedMethodAccessor761.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
Environment
- Liferay DXP 7.0+
Resolution
-
This failure is due to an inconsistent configuration between the portal-ext.properties and the Custom Fields instance settings.
-
The exception is thrown when the property
users.export.csv.fields
has an expando attribute defined and this attribute is not set in the instance in which users are exported. -
To resolve this problem, both configurations, instance settings and portal-ext.properties, must be aligned. If an expando attribute is added in
users.export.csv.fields
, this new attribute must be defined in all instances.