1

I am setting up Liferay (Portal 7.4.3 ga55) development environment using Intellij (with Liferay plugin) and Gradle plugin. Created a new Liferay workspace project. Next created a service builder module and executed gradle buildService task for -service module. So far so good. But when i try to run gradle build task for -service module, i receive following error in -service module

1. FooModelImpl.java : toXmlString method does not override or implement a method from a supertype

  1. FooPersistenceImpl.java : method getResult in interface FinderCache cannot be applied to given types; required: FinderPath,Object[],BasePersistence<?> found: FinderPath,Object[] reason: actual and formal argument lists differ in length

What i am doing incorrectly ?

service.xml

<?xml version="1.0"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 7.4.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_7_4_0.dtd">

<service-builder dependency-injector="ds" package-path="com.sample.core">
    <namespace>FOO</namespace>
    <entity local-service="true" name="Foo" remote-service="false" uuid="true">
        <column name="fooId" primary="true" type="long" />
        <column name="groupId" type="long" />
        <column name="companyId" type="long" />
        <column name="userId" type="long" />
        <column name="userName" type="String" />
        <column name="createDate" type="Date" />
        <column name="modifiedDate" type="Date" />
        <column name="field1" type="String" />
        <column name="field2" type="boolean" />
        <column name="field3" type="int" />
        <column name="field4" type="Date" />
        <column name="field5" type="String" />
        <order by="asc">
            <order-column name="field1" />
        </order>
    </entity>
</service-builder>

gradle.properties

liferay.workspace.modules.dir=modules
liferay.workspace.themes.dir=themes
liferay.workspace.wars.dir=modules
microsoft.translator.subscription.key= 
liferay.workspace.product=portal-7.4-ga55 
target.platform.index.sources = false 
liferay.workspace.bundle.url=https://releases-cdn.liferay.com/portal/7.4.3.55-ga55/liferay-ce-portal-tomcat-7.4.3.55-ga55-20221214100304403.tar.gz

I have tried updating liferay.workspace.product & liferay.workspace.bundle.url in gradle.properties file but no success

  • Your service builder code looks OK. I would recommend removing the bundle URL since the `liferay.workspace.product` should handle setting that property. I would recommend you take a look at the Liferay Workspace Gradle plugin. I had a similar issue and was addressed by updating the liferay workspace plugin. You can try to use blade to generate a new workspace for your product and compare the values on the workspace's `settings.gradle`. – Byob Jan 26 '23 at 14:09

2 Answers2

1

After going through LPS-166596, I updated settings.gradle file with 4.0.22 version and it worked as charms

classpath(group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "4.0.22")
0

Currently, you'll have to overwrite your build.gradle in the service module like this:

dependencies {
    compile project(":modules:foo:foo-api")

    compileOnly group: "com.liferay.portal", name: "release.dxp.api"
    
    serviceBuilder group: "com.liferay", name: "com.liferay.portal.tools.service.builder", version: "1.0.445"
    
}

buildService {
    apiDir = "../foo-api/src/main/java"
}

group = "com.liferay.samples.fbo.foo"

The reason is this: https://issues.liferay.com/browse/LPS-166596

  • Thankyou for showing me the way. Although this solution didn't helped. – Sachin Goyal Feb 16 '23 at 09:19
  • Hi Fabian, next i am facing this issue while deploying servicebuilder. Please help here too.. https://stackoverflow.com/questions/75297790/liferay-7-4-3-61-blob-type-column-in-service-builder – Sachin Goyal Feb 20 '23 at 11:17