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().
这篇文章有帮助吗?
0 人中有 0 人觉得有帮助