ClassNotFoundException when using DynamicQueryFactoryUtil.forClass

Issue

  • When trying to using Dynamic Queries there can be ClassNotFoundException errors if the DynamicQuery is obtained using the method DynamicQueryFactoryUtil.forClass.

Environment

  • Liferay DXP 7.0+

Resolution

  • To avoid this type of exceptions, consider using the available method in the API: {className}LocalServiceUtil.dynamicQuery().
  • For example:
    • instead of using DynamicQueryFactoryUtil.forClass(DDLRecord.class),
    • try using DDLRecordLocalServiceUtil.dynamicQuery().
¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0