<?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>Service Builder Custom SQL Issue</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113957825" />
  <subtitle>Service Builder Custom SQL Issue</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113957825</id>
  <updated>2026-04-03T18:09:25Z</updated>
  <dc:date>2026-04-03T18:09:25Z</dc:date>
  <entry>
    <title>RE: Service Builder Custom SQL Issue</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119169289" />
    <author>
      <name>Sergio Sanchez</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119169289</id>
    <updated>2020-05-17T12:24:05Z</updated>
    <published>2020-05-17T12:24:05Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi, &lt;br&gt;just in case anyone finds this problem in their Custom Finder developments for Liferay 7.x&lt;br&gt;You will need:&lt;br&gt;1. A dependency in Gradle or Maven like the following:&lt;br&gt;&lt;pre&gt;&lt;code&gt;compileOnly group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql.api"&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;2. Make sure that your FinderImpl class in registered as an OSGi component and you import the correct CustomSQL class:&lt;br&gt;&lt;pre&gt;&lt;code&gt;import com.liferay.portal.dao.orm.custom.sql.CustomSQL;
​​​​​​​[...]
@Component(service = ExtUserFinder.class)
public class ExtUserFinderImpl extends ExtUserFinderBaseImpl implements ExtUserFinder{
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;Hope it helps if someone runs into this problem&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Sergio Sanchez</dc:creator>
    <dc:date>2020-05-17T12:24:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: Service Builder Custom SQL Issue</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113958204" />
    <author>
      <name>Neil Francese</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113958204</id>
    <updated>2019-06-10T21:13:43Z</updated>
    <published>2019-06-10T21:13:43Z</published>
    <summary type="html">The more I read the more I&amp;#39;m assuming that com.liferay.util.java is an optional include and therefore can be embedded in my module using compileInclude for gradle users or in my case, as I&amp;#39;m using maven,  using bnd.bnd -includeresource directive.&lt;br /&gt;If anyone thinks this is not the preferred way let me know as I suspect this will work but not sure if it&amp;#39;s the Liferay way ;)</summary>
    <dc:creator>Neil Francese</dc:creator>
    <dc:date>2019-06-10T21:13:43Z</dc:date>
  </entry>
  <entry>
    <title>Service Builder Custom SQL Issue</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113957824" />
    <author>
      <name>Neil Francese</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113957824</id>
    <updated>2019-06-10T20:25:37Z</updated>
    <published>2019-06-10T20:25:37Z</published>
    <summary type="html">I&amp;#39;m upgraded a 6.2 Service Builder Entity to be a module in a fixpack DXP,-5-7110 bundle.   I was able to deploy the -service and -api fine.  Things seem to work for most of my basic entities but I encountered a problem when adding a bit of custom SQL.   Everything compiles fine but when I deploy the -api continues to load properly but the -service module encounters the following error &lt;br /&gt;&lt;br /&gt;org.osgi.framework.BundleException: Could not resolve module: xxx.xxx.core.service [1012]_  Unresolved requirement: Import-Package: com.liferay.util.dao.orm; version=&amp;#34;[7.0.0,8.0.0)&amp;#34;_ [Sanitized]&lt;br /&gt;    at org.eclipse.osgi.container.Module.start(Module.java:444)&lt;br /&gt;    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)&lt;br /&gt;    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1258)&lt;br /&gt;    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1230)&lt;br /&gt;    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1218)&lt;br /&gt;    at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:507)&lt;br /&gt;    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)&lt;br /&gt;    at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)&lt;br /&gt;&lt;br /&gt;It seems to be related to one of my finders that uses:  &amp;#34;import com.liferay.util.dao.orm.CustomSQL;&amp;#34; for the @ServiceReference annotation as described in liferay documentation (&lt;a href="https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/custom-sql"&gt;https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/custom-sql&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt; @ServiceReference(type = CustomSQL.class)&lt;br /&gt;    private CustomSQL _customSQL;&lt;br /&gt;&lt;br /&gt;I see &amp;#39;com.liferay.util.dao.orm.CustomSQL&amp;#39; should be provided by util-java.jar   I have the following dependency declared in my pom which resolves for compilation but doesn&amp;#39;t seem to be satisfied by the server at run time.  &lt;br /&gt;        &amp;lt;dependency&amp;gt;&lt;br /&gt;            &amp;lt;groupId&amp;gt;com.liferay.portal&amp;lt;/groupId&amp;gt;&lt;br /&gt;            &amp;lt;artifactId&amp;gt;com.liferay.util.java&amp;lt;/artifactId&amp;gt;&lt;br /&gt;            &amp;lt;version&amp;gt;3.0.17&amp;lt;/version&amp;gt;&lt;br /&gt;            &amp;lt;scope&amp;gt;provided&amp;lt;/scope&amp;gt;&lt;br /&gt;        &amp;lt;/dependency&amp;gt;&lt;br /&gt;&lt;br /&gt;If I add com.liferay.util.java-3.0.17.jar directly to my osgi/modules folder it resolves and the -service module deploys but I suspect that this functionality should already be on the classpath somewhere and perhaps I have a configuration issue? .  Any ideas?</summary>
    <dc:creator>Neil Francese</dc:creator>
    <dc:date>2019-06-10T20:25:37Z</dc:date>
  </entry>
</feed>
