Syed Nouman Naseer
Syed Nouman Naseer

Reputation: 13

Liferay 7: While deploying a service using service builder i am getting a bundle exception

I am new to liferay 7 and while going through its tutorials, when i tried to build a new service using service builder during its deployment i am getting this bundle exception,

Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[1.0.0,1.1.0)"

In gogo shell my services are showing as installed but when i try to start them then it throws above error.

I have tried googling it but could not found its solution. Any help is highly appreciated. Thanks

Service-api build.gradle

dependencies {
    compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
    compileOnly group: "com.liferay", name: "com.liferay.osgi.util", version: "3.0.0"
    compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
    compileOnly group: "org.osgi", name: "org.osgi.core", version: "6.0.0"
}

Service-servce build.gradle

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

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

group = "com.demo"

Upvotes: 0

Views: 539

Answers (1)

Victor
Victor

Reputation: 3698

Chances are the tutorials were made for an earlier version of the portal. Your module was installed but it cannot transition to active due to its missing dependency. You will want to go through the dependencies you declared and update their version numbers.

Upvotes: 0

Related Questions