<?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>Interface Error CustomSQL</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112774930" />
  <subtitle>Interface Error CustomSQL</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112774930</id>
  <updated>2026-04-05T03:40:37Z</updated>
  <dc:date>2026-04-05T03:40:37Z</dc:date>
  <entry>
    <title>RE: Interface Error CustomSQL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113638916" />
    <author>
      <name>Dorian Penot</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113638916</id>
    <updated>2019-05-15T10:10:27Z</updated>
    <published>2019-05-15T10:10:27Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;I don't know because for me thi worked :&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;compileOnly group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.0"&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;But this didn't worked : &lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;​​​​​​​compileOnly group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.3"&lt;/code&gt;&lt;/pre&gt;​​​​​​​I have no idea where it come from, i didn't tried with sql.api ...&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Dorian Penot</dc:creator>
    <dc:date>2019-05-15T10:10:27Z</dc:date>
  </entry>
  <entry>
    <title>RE: Interface Error CustomSQL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113490007" />
    <author>
      <name>Amos Fong</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113490007</id>
    <updated>2019-05-01T23:02:18Z</updated>
    <published>2019-05-01T23:02:18Z</published>
    <summary type="html">FYI, just ran into this error on 7.1 which was caused by a wrong module import name:&lt;br /&gt;&lt;br /&gt;good:&lt;br /&gt;    compileOnly group: &amp;#34;com.liferay&amp;#34;, name: &amp;#34;com.liferay.portal.dao.orm.custom.sql.api&amp;#34;, version: &amp;#34;1.0.0&amp;#34;&lt;br /&gt;&lt;br /&gt;bad:&lt;br /&gt;    compileOnly group: &amp;#34;com.liferay&amp;#34;, name: &amp;#34;com.liferay.portal.dao.orm.custom.sql&amp;#34;, version: &amp;#34;1.0.0&amp;#34;</summary>
    <dc:creator>Amos Fong</dc:creator>
    <dc:date>2019-05-01T23:02:18Z</dc:date>
  </entry>
  <entry>
    <title>RE: Interface Error CustomSQL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112843526" />
    <author>
      <name>Amos Fong</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112843526</id>
    <updated>2019-03-20T15:58:10Z</updated>
    <published>2019-03-20T15:58:10Z</published>
    <summary type="html">That&amp;#39;s strange, maybe your runtime environment doesn&amp;#39;t have 1.0.3? Anyway, glad it&amp;#39;s working now &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" &gt;</summary>
    <dc:creator>Amos Fong</dc:creator>
    <dc:date>2019-03-20T15:58:10Z</dc:date>
  </entry>
  <entry>
    <title>RE: Interface Error CustomSQL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112828710" />
    <author>
      <name>Dorian Penot</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112828710</id>
    <updated>2019-03-20T08:34:52Z</updated>
    <published>2019-03-20T08:34:52Z</published>
    <summary type="html">Ok i changed the import like this : &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;    compileInclude group: &amp;#34;com.liferay&amp;#34;, name: &amp;#34;com.liferay.portal.dao.orm.custom.sql&amp;#34;, version: &amp;#34;1.0.0&amp;#34;&lt;/blockquote&gt;So i would say that if I import 1.0.3 it don&amp;#39;t work for me but 1.0.0 work ? that&amp;#39;s realy weird but thank you for your help ! </summary>
    <dc:creator>Dorian Penot</dc:creator>
    <dc:date>2019-03-20T08:34:52Z</dc:date>
  </entry>
  <entry>
    <title>RE: Interface Error CustomSQL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112828046" />
    <author>
      <name>Dorian Penot</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112828046</id>
    <updated>2019-03-20T08:30:56Z</updated>
    <published>2019-03-20T08:30:56Z</published>
    <summary type="html">When I use CustomSqlUtil the error is worst, just give me this : &lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;2019-03-20 08:29:23.791 ERROR [http-nio-8080-exec-2][JSONWebServiceServiceAction:116] com/liferay/portal/dao/orm/custom/sql/CustomSQLUtil&lt;/blockquote&gt;I don&amp;#39;t have anything else and it don&amp;#39;t work neither. I changed my dependencie like yours but still the same. &lt;br /&gt;&lt;br /&gt;I realy don&amp;#39;t understand what i did wrong </summary>
    <dc:creator>Dorian Penot</dc:creator>
    <dc:date>2019-03-20T08:30:56Z</dc:date>
  </entry>
  <entry>
    <title>RE: Interface Error CustomSQL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112787623" />
    <author>
      <name>Amos Fong</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112787623</id>
    <updated>2019-03-16T00:20:43Z</updated>
    <published>2019-03-16T00:20:43Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;This works for me:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;import com.liferay.portal.dao.orm.custom.sql.CustomSQLUtil;
...

CustomSQLUtil.get(getClass(), "xxx")&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;and my bnd:&lt;br&gt;&lt;pre&gt;&lt;code&gt;compileOnly group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.0"&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;What's the full stacktrace when you try that?&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Amos Fong</dc:creator>
    <dc:date>2019-03-16T00:20:43Z</dc:date>
  </entry>
  <entry>
    <title>Interface Error CustomSQL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112774929" />
    <author>
      <name>Dorian Penot</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112774929</id>
    <updated>2019-03-15T09:02:13Z</updated>
    <published>2019-03-15T09:02:13Z</published>
    <summary type="html">Hi,&lt;br /&gt;&lt;br /&gt;I followed &lt;a href="https://dev.liferay.com/fr/develop/tutorials/-/knowledge_base/7-0/custom-sql"&gt;this &lt;/a&gt;and got a weird error, i din&amp;#39;t found it anywhere before :&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;2019-03-15 08:52:20.145 ERROR [http-nio-8080-exec-8][JSONWebServiceServiceAction:116] Found interface com.liferay.portal.dao.orm.custom.sql.CustomSQL, but class was expected&lt;/blockquote&gt;&lt;br /&gt;I tried all i found about CustomSQL on the net, when i replace CustomSQL with CustomSQLUtil i have an error returning : &lt;br /&gt;​​​​​​​&lt;blockquote&gt;2019-03-15 08:50:31.324 ERROR [http-nio-8080-exec-4][JSONWebServiceServiceAction:116] com/liferay/portal/dao/orm/custom/sql/CustomSQLUtil&lt;/blockquote&gt;&lt;br /&gt;I realy don&amp;#39;t know what to do, the package is in my dependencies&amp;#39; folder, i can open the CustomSQL* classes but i can&amp;#39;t use any of their methods&lt;br /&gt;&lt;br /&gt;Help ! &lt;br /&gt;&lt;br /&gt;here is the part of my code wich don&amp;#39;t work : &lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;    public static final String FIND_BY_ROLES_ID_AND_PORTLET_ID_AND_ENTITY =&lt;br /&gt;            PermissionFinder.class.getName() +&lt;br /&gt;                &amp;#34;.findByRolesIdAndPortletIdAndEntity&amp;#34;;&lt;br /&gt;&lt;br /&gt;    @ServiceReference(type=CustomSQL.class)&lt;br /&gt;    private CustomSQL _customSQL;&lt;br /&gt;    &lt;br /&gt;    public List&amp;lt;Permission&amp;gt; findByRolesIdAndPortletIdAndEntity(long[] roleIds, String portletId, String entity){&lt;br /&gt;        Session session = null;&lt;br /&gt;        try {&lt;br /&gt;            session = openSession();&lt;br /&gt;            &lt;br /&gt;            //System.out.println(CustomSQLUtil.class);&lt;br /&gt;            String sql = _customSQL.get(getClass(), FIND_BY_ROLES_ID_AND_PORTLET_ID_AND_ENTITY);&lt;br /&gt;            System.out.println(&amp;#34;La Requete : &amp;#34;+sql);&lt;br /&gt;            SQLQuery q = session.createSQLQuery(sql);&lt;br /&gt;            q.setCacheable(false);&lt;br /&gt;            q.addEntity(&amp;#34;agiirpermission&amp;#34;, PermissionImpl.class);&lt;br /&gt;            System.out.println(&amp;#34;La SQL Query : &amp;#34;+q);&lt;br /&gt;            QueryPos qPos = QueryPos.getInstance(q);&lt;br /&gt;            qPos.add(roleIds);&lt;br /&gt;            qPos.add(portletId);&lt;br /&gt;            qPos.add(entity);&lt;br /&gt;            return (List&amp;lt;Permission&amp;gt;) QueryUtil.list(q, getDialect(), 0, 0);&lt;br /&gt;        }&lt;br /&gt;        catch (Exception e) {&lt;br /&gt;            try {&lt;br /&gt;                throw new SystemException(e);&lt;br /&gt;            }&lt;br /&gt;            catch (SystemException se) {&lt;br /&gt;                se.printStackTrace();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        finally {&lt;br /&gt;            closeSession(session);&lt;br /&gt;        }&lt;br /&gt;        return new ArrayList&amp;lt;Permission&amp;gt;();&lt;br /&gt;    }&lt;/blockquote&gt; </summary>
    <dc:creator>Dorian Penot</dc:creator>
    <dc:date>2019-03-15T09:02:13Z</dc:date>
  </entry>
</feed>
