<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Liferay 7.2- Alternative to ClpSerializer</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114613349" />
  <subtitle>Liferay 7.2- Alternative to ClpSerializer</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=114613349</id>
  <updated>2026-04-04T10:50:19Z</updated>
  <dc:date>2026-04-04T10:50:19Z</dc:date>
  <entry>
    <title>RE: Liferay 7.2- Alternative to ClpSerializer</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114620179" />
    <author>
      <name>Fabio Carvalho</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114620179</id>
    <updated>2019-08-06T09:44:52Z</updated>
    <published>2019-08-06T09:44:52Z</published>
    <summary type="html">Hi Mohammed,&lt;br /&gt;&lt;br /&gt;Your way is working perfectly. Thank you very much!</summary>
    <dc:creator>Fabio Carvalho</dc:creator>
    <dc:date>2019-08-06T09:44:52Z</dc:date>
  </entry>
  <entry>
    <title>RE: Liferay 7.2- Alternative to ClpSerializer</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114613706" />
    <author>
      <name>Mohammed Yasin</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114613706</id>
    <updated>2019-08-05T18:03:46Z</updated>
    <published>2019-08-05T18:03:46Z</published>
    <summary type="html">Hi,&lt;br /&gt;Try using this&lt;br /&gt;DynamicQuery query = EntityLocalServiceUtil.dynamicQuery();&lt;br /&gt;query.add(PropertyFactoryUtil.forName(&amp;#34;userId&amp;#34;).eq((int) theme.getLayout().getUserId()));&lt;br /&gt;List&amp;lt;Entity&amp;gt; entities = EntityLocalServiceUtil.dynamicQuery(query);</summary>
    <dc:creator>Mohammed Yasin</dc:creator>
    <dc:date>2019-08-05T18:03:46Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7.2- Alternative to ClpSerializer</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114613348" />
    <author>
      <name>Fabio Carvalho</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=114613348</id>
    <updated>2019-08-05T17:40:56Z</updated>
    <published>2019-08-05T17:40:56Z</published>
    <summary type="html">I have created a service builder module and I have also successfully integrated with my portlet module.&lt;br /&gt;&lt;br /&gt;Now I am trying to execute a DynamicQuery and I am getting an ClassNofFoundException error. He cant found my packagename.model.impl.EntityImpl.&lt;br /&gt;&lt;br /&gt;I am doing my query like this:&lt;br /&gt;&lt;blockquote&gt;DynamicQuery query = DynamicQueryFactoryUtil.forClass(Entity.class, Entity.class.getClassLoader());&lt;br /&gt;query.add(PropertyFactoryUtil.forName(&amp;#34;userId&amp;#34;).eq((int) theme.getLayout().getUserId()));&lt;br /&gt;​​​​​​​&lt;br /&gt;List&amp;lt;Entity&amp;gt; entities = EntityLocalServiceUtil.dynamicQuery(query);&lt;/blockquote&gt;&lt;br /&gt;I have seen that this should be a classLoader problem and the solution should be using the ClpSerializer class:&lt;br /&gt;&lt;blockquote&gt;ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.SERVLET_CONTEXT_NAME, &amp;#34;portletClassLoader&amp;#34;);&lt;/blockquote&gt;&lt;br /&gt;But my service builder didn&amp;#39;t generate this class. If I understand correctly, it doesn&amp;#39;t generated anymore. So, is there any alternative to the ClpSerializer? How should I use the classLoader to execute the query correctly?</summary>
    <dc:creator>Fabio Carvalho</dc:creator>
    <dc:date>2019-08-05T17:40:56Z</dc:date>
  </entry>
</feed>
