2

我创建了一个服务构建器,在 *-service 中我需要 com.liferay.util.dao.orm.CustomSQLUtil 来执行自定义 sql。我创建了 *FinderImpl 并创建了一个使用 CustomSQLUtil 的方法。我成功构建并部署了 *-api 和 *-service。但是当我将 *-api 和 *-service 拖放到正在运行的服务器上时,就会出现上述错误。我的 bnd.bnd 文件如下:-

Bundle-SymbolicName: customuser-service
Bundle-Version: 1.0.0
Liferay-Require-SchemaVersion: 1.0.0
Liferay-Service: true
Bundle-ClassPath:\
   .,\
   lib/util-java.jar,\

build.gradle 如下:-

dependencies {
    compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
    compile group: "com.liferay", name: "com.liferay.osgi.util", version: "3.0.0"
    compile group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.0.0"
    compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.6.0"
    compile project(":modules:customuser:customuser-api")

    compile group: 'com.liferay.portal', name: 'portal-kernel', version: '5.2.3'

    compile group: 'com.liferay.portal', name: 'util-java', version: '6.2.4'

}

buildService {
    apiDir = "../customuser-api/src/main/java"
    osgiModule = true
    propsUtil = "com.example.service.util.PropsUtil"
}

请帮助...thanx提前..

4

2 回答 2

0

你不需要那个导入,它永远不会解决。

使用“com.liferay.portal.dao.orm.custom.sql.CustomSQLUtil”代替 gradle dep:“com.liferay:com.liferay.portal.dao.orm.custom.sql:1.0.0”。

于 2019-06-17T07:02:56.833 回答
0

尝试添加此行

provided group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.0"

到您的 build.gradle 依赖项。例如:

dependencies {
    compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
    compile group: "com.liferay", name: "com.liferay.osgi.util", version: "3.0.0"
    compile group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.0.0"
    compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.6.0"
    compile project(":modules:customuser:customuser-api")
    compile group: 'com.liferay.portal', name: 'portal-kernel', version: '5.2.3'
    compile group: 'com.liferay.portal', name: 'util-java', version: '6.2.4'

    provided group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.0"

}
于 2016-11-24T13:14:39.697 回答