ServiceBuilder is Importing petra StringBundler instead of kernel.StringBunServiceBuilder is Importing petra StringBundler instead of kernel.StringBunhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1112960562024-03-29T13:42:55Z2024-03-29T13:42:55ZRE: ServiceBuilder is Importing petra StringBundler instead of kernel.StrinSatyanarayana kolliboyinhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1148811902019-08-26T09:10:21Z2019-08-26T09:10:21ZAfter updated dependency as below issue is resolved.Before : compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "3.64.1" After (working) : compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: <strong>"3.0.0"</strong> Satyanarayana kolliboyin2019-08-26T09:10:21ZRE: ServiceBuilder is Importing petra StringBundler instead of kernel.StrinMinhchau Danghttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1113475342018-10-26T20:33:20Z2018-10-26T20:33:20Z<blockquote>David Ilechukwu<br /><br />How do I resolve this please? Is this a servicebuilder issue?</blockquote><br />Yes, it's a service builder issue. I'm not exactly sure why this thread was forked from your <a href="https://community.liferay.com/forums/-/message_boards/message/111346540">other thread</a>, but you can read the reply there for ways to resolve the issue.Minhchau Dang2018-10-26T20:33:20ZRE: ServiceBuilder is Importing petra StringBundler instead of kernel.StrinDavid Ilechukwuhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1112990592018-10-24T08:10:19Z2018-10-24T08:10:19Z<html><head></head><body><blockquote>Michel Schmidt<blockquote>However, the blogs-service module source code shows that the service builder uses the 7.1.0 servicebuilder and yet the generated -ServiceImplPersistence classes import the com.liferay.portal.kernel.util.StringBundler class rather than com.liferay.petra.string.StringBundler - wondering how that works.<br></blockquote><br>From what I can see, the dependency changed in most modules from com.liferay.portal.kernel.util.StringBundler to com.liferay.petra.string.StringBundler (both in the 7.1-branch and also in the master-branch).<br><br>Some examples: <a href="https://github.com/liferay/liferay-portal/blob/master/modules/apps/blogs/blogs-service/build.gradle#L34">Here</a>, <a href="https://github.com/liferay/liferay-portal/blob/7.1.x/modules/apps/blogs/blogs-service/build.gradle#L18">here</a>, <a href="https://github.com/liferay/liferay-portal/blob/7.1.x/modules/apps/blogs/blogs-service/build.gradle#L18">here</a>, <a href="https://github.com/liferay/liferay-portal/blob/master/modules/apps/announcements/announcements-web/build.gradle#L18">here</a> and <a href="https://github.com/liferay/liferay-portal/blob/7.1.x/modules/apps/announcements/announcements-web/build.gradle#L8">here</a>.<br><br>I also have ported a customized liferay core app to 7.1 and remember having done the same.</blockquote>Many thanks Michel - for your quick reply! Yes, you're right. There's been a change in dependency from kernel StringBundler to petra package StringBundler (I've even included those same petra package dependencies in my own build.gradle). See here...<br><pre><code>buildscript {
&nbsp; &nbsp; dependencies {
&nbsp; &nbsp; &nbsp; &nbsp; classpath group: "com.liferay", name: "com.liferay.gradle.plugins.service.builder", version: "2.1.61"
&nbsp; &nbsp; }
&nbsp; &nbsp; repositories {
&nbsp; &nbsp; &nbsp; &nbsp; maven {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url "https://repository-cdn.liferay.com/nexus/content/groups/public"
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; }
} &nbsp; &nbsp;
apply plugin: "com.liferay.portal.tools.service.builder"
dependencies {
&nbsp; &nbsp; compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
&nbsp; &nbsp; compileOnly group: "com.liferay", name: "com.liferay.portal.spring.extender.api", version: "3.0.0"
&nbsp; &nbsp; compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "3.0.0"
&nbsp; &nbsp; compileOnly group: "com.liferay", name: "com.liferay.petra.function", version: "2.0.0"
&nbsp; &nbsp; compileOnly group: "com.liferay", name: "com.liferay.petra.model.adapter", version: "2.0.0"
&nbsp; &nbsp; compileOnly group: "com.liferay", name: "com.liferay.petra.reflect", version: "2.0.0"
&nbsp; &nbsp; compileOnly group: "com.liferay", name: "com.liferay.petra.string", version: "2.0.0" &nbsp; &nbsp;
&nbsp; &nbsp; compileOnly group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql.api", version: "1.0.0"
&nbsp; &nbsp; compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.0"
&nbsp; &nbsp; compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
&nbsp; &nbsp; compileOnly group: "org.osgi", name: "org.osgi.core", version: "5.0.0"
&nbsp; &nbsp; compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0" &nbsp; &nbsp;
&nbsp; &nbsp; compileOnly project(":hrm_core-api")
}
</code></pre><br>But why then does the code generated by ServiceBuilder in my -ServicePersistenceImpl classes throw compile errors like this...<pre><code>C:\Software\Devel\Src\Web\Component\hrm_core\hrm_core-service\src\main\java\com\tpl\pmedics\hrm_core\service\persistence\impl\JobVacancyPersistenceImpl.java:734: error: incompatible types: com.liferay.petra.string.StringBundler cannot be converted to com.liferay.portal.kernel.util.StringBundler
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
</code></pre><br>Apparently, the generated code is expecting the "query" object to be an instance of com.liferay.portal.kernel.util.StringBundler rather than com.liferay.petra.string.StringBundler in this method...<pre><code>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;if (orderByComparator != null) {
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;orderByComparator);
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}</code></pre><br>How do I resolve this please? Is this a servicebuilder issue?<br><br>Thanks.</body></html>David Ilechukwu2018-10-24T08:10:19ZRE: ServiceBuilder is Importing petra StringBundler instead of kernel.StrinMichel Schmidthttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1112977092018-10-24T05:58:00Z2018-10-24T05:58:00Z<blockquote>However, the blogs-service module source code shows that the service builder uses the 7.1.0 servicebuilder and yet the generated -ServiceImplPersistence classes import the com.liferay.portal.kernel.util.StringBundler class rather than com.liferay.petra.string.StringBundler - wondering how that works.<br /></blockquote><br />From what I can see, the dependency changed in most modules from com.liferay.portal.kernel.util.StringBundler to com.liferay.petra.string.StringBundler (both in the 7.1-branch and also in the master-branch).<br /><br />Some examples: <a href="https://github.com/liferay/liferay-portal/blob/master/modules/apps/blogs/blogs-service/build.gradle#L34">Here</a>, <a href="https://github.com/liferay/liferay-portal/blob/7.1.x/modules/apps/blogs/blogs-service/build.gradle#L18">here</a>, <a href="https://github.com/liferay/liferay-portal/blob/7.1.x/modules/apps/blogs/blogs-service/build.gradle#L18">here</a>, <a href="https://github.com/liferay/liferay-portal/blob/master/modules/apps/announcements/announcements-web/build.gradle#L18">here</a> and <a href="https://github.com/liferay/liferay-portal/blob/7.1.x/modules/apps/announcements/announcements-web/build.gradle#L8">here</a>.<br /><br />I also have ported a customized liferay core app to 7.1 and remember having done the same.Michel Schmidt2018-10-24T05:58:00ZServiceBuilder is Importing petra StringBundler instead of kernel.StringBunDavid Ilechukwuhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1112960552018-10-24T02:40:26Z2018-10-24T02:40:26Z<html><head></head><body>Hello folks!<br>The -ServicePersistenceImpl classes generated by ServiceBuilder all import the com.liferay.petra.string.StringBundler class instead of the com.liferay.portal.kernel.util.StringBundler class. This causes an compile error in the <br><pre><code>appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;orderByComparator)
</code></pre>method which is expecting a query argument of type com.liferay.portal.kernel.util.StringBundler.<br><br>The following error is thrown<pre><code>C:\Software\Devel\Src\Web\Component\hrm_core\hrm_core-service\src\main\java\com\tpl\pmedics\hrm_core\service\persistence\impl\JobVacancyPersistenceImpl.java:231: error: incompatible types: com.liferay.petra.string.StringBundler cannot be converted to com.liferay.portal.kernel.util.StringBundler
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^
C:\Software\Devel\Src\Web\Component\hrm_core\hrm_core-service\src\main\java\com\tpl\pmedics\hrm_core\service\persistence\impl\JobVacancyPersistenceImpl.java:734: error: incompatible types: com.liferay.petra.string.StringBundler cannot be converted to com.liferay.portal.kernel.util.StringBundler
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
</code></pre><br>I'm using ServiceBuilder plugin declared as follows in my build.gradle<pre><code>buildscript {
&nbsp; &nbsp; dependencies {
&nbsp; &nbsp; &nbsp; &nbsp; classpath group: "com.liferay", name: "com.liferay.gradle.plugins.service.builder", version: "2.1.61"
&nbsp; &nbsp; }
&nbsp; &nbsp; repositories {
&nbsp; &nbsp; &nbsp; &nbsp; maven {
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; url "https://repository-cdn.liferay.com/nexus/content/groups/public"
&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; }
} &nbsp; &nbsp;
apply plugin: "com.liferay.portal.tools.service.builder"
</code></pre><br>Also, I noticed that servicebuilder started importing the petra package StringBundler after I changed the dtd declaration in my service.xml file from <pre><code>
</code></pre>to<pre><code></code></pre><br>It imports the com.liferay.portal.kernel.util.StringBundler class when the dtd is 7.0.0 rather than 7.1.0<br><br>However, the blogs-service module source code shows that the service builder uses the 7.1.0 servicebuilder and yet the generated -ServiceImplPersistence classes impo