<?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.0  CustomSQL Gives an error- Null is not a valid include</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113447489" />
  <subtitle>Liferay 7.0  CustomSQL Gives an error- Null is not a valid include</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113447489</id>
  <updated>2026-04-04T09:17:29Z</updated>
  <dc:date>2026-04-04T09:17:29Z</dc:date>
  <entry>
    <title>RE: Liferay 7.0  CustomSQL Gives an error- Null is not a valid include</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113479760" />
    <author>
      <name>Andrew Jardine</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113479760</id>
    <updated>2019-05-01T03:26:00Z</updated>
    <published>2019-05-01T03:26:00Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Cesar,&lt;br&gt;&lt;br&gt;I am pretty sure I had the same problem around this time last year. Just looking back at that project I ended up just using --&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;import com.liferay.portal.dao.orm.custom.sql.CustomSQLUtil;&lt;/code&gt;&lt;/pre&gt;and for my gradle reference I have&lt;br&gt;&lt;pre&gt;&lt;code&gt;compileOnly group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.4"&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;I don't have an @ServiceReference at all. Now I know that in the case of the *LocalService classes, it's bad form to use the Util version as you don't reap the benefits of OSGI dependency management etc, but it looks like in the end I just stuck with a straight call.&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;String sql = CustomSQLUtil.get(getClass(), FIND_RECIPIENTS);&lt;/code&gt;&lt;/pre&gt;FWIWT, normally when I am using an @ServiceReference I include the full canonical name -- so in this case it would be&lt;br&gt;&lt;pre&gt;&lt;code&gt;@ServiceReference(type=com.liferay.portal.dao.orm.custom.sql.CustomSQL.class)
private CustomSQL _customSQL;
&lt;/code&gt;&lt;/pre&gt;Not sure if that will make a difference, but it'd be an easy test.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Andrew Jardine</dc:creator>
    <dc:date>2019-05-01T03:26:00Z</dc:date>
  </entry>
  <entry>
    <title>Liferay 7.0  CustomSQL Gives an error- Null is not a valid include</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113447488" />
    <author>
      <name>César Casado</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113447488</id>
    <updated>2019-04-29T11:33:43Z</updated>
    <published>2019-04-29T11:33:43Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;When I put&lt;pre&gt;&lt;code&gt;@ServiceReference (type = CustomSQL.class)
private CustomSQL _customSQL;&lt;/code&gt;&lt;/pre&gt;in my * FinderImpl.java of my service module, I get an error in the web module:&lt;pre&gt;&lt;code&gt;ERROR [http-nio-8080-exec-5][MVCPortlet:589] null is not a valid include&lt;/code&gt;&lt;/pre&gt;even without actually using it.&lt;br&gt;&lt;br&gt;I have the default.xml in the custom-sql folder within resources / META-INF and in my build.gradle&lt;pre&gt;&lt;code&gt;compile group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.4"&lt;/code&gt;&lt;/pre&gt;The import com.liferay.portal.dao.orm.custom.sql.CustomSQL is done correctly .&lt;br&gt;​​​​​​​&lt;br&gt;I am doing something wrong?&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>César Casado</dc:creator>
    <dc:date>2019-04-29T11:33:43Z</dc:date>
  </entry>
</feed>
