留言板

Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,4.)"

Revathi Vadlamudi,修改在7 年前。

Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,4.)"

Junior Member 帖子: 82 加入日期: 14-11-14 最近的帖子
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:mm-service-builder:mm-service-builder-api")

	compileOnly group: 'com.liferay.portal', name: 'com.liferay.util.java', version: '2.2.2'
	compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
	compileOnly group: 'javax.portlet', name: 'portlet-api', version: '3.0.0'
	compileOnly group: "commons-httpclient", name: "commons-httpclient", version: "3.1"
	compileOnly group: 'org.json', name: 'org.json', version: '2.0'
	compileOnly group: 'org.apache.clerezza.ext', name: 'org.json.simple', version: '0.4'
	compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
	compileOnly group: 'com.liferay.portal', name: 'com.liferay.portal.impl', version: '2.11.0'
	compileOnly group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.6" 
}

buildService {
	apiDir = "../mm-service-builder-api/src/main/java"
}

group = "mm.service.builder"


bnd.bnd

Bundle-Name: mm-service-builder-service
Bundle-SymbolicName: mm.service.builder.service
Bundle-Version: 1.0.0
Liferay-Require-SchemaVersion: 1.0.0
Liferay-Service: true



Error dispalyed as below. Any clue?

org.osgi.framework.BundleException: Could not resolve module: mm.service.builder.service [633]
Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,4.0.0)"
thumbnail
David H Nebinger,修改在7 年前。

RE: Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
You should add the portlet and servlet APIs to the dependencies in build.gradle.
Revathi Vadlamudi,修改在7 年前。

RE: Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,

Junior Member 帖子: 82 加入日期: 14-11-14 最近的帖子
I already added portlet and servlet APIs to dependencies in build.gradle

   compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
compileOnly group: 'javax.portlet', name: 'portlet-api', version: '3.0.0'
thumbnail
David H Nebinger,修改在7 年前。

RE: Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Why are you using portlet 3 spec? The thing's not even final yet and no one has implemented support for it.
Revathi Vadlamudi,修改在7 年前。

RE: Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,

Junior Member 帖子: 82 加入日期: 14-11-14 最近的帖子
Still serivce is not running. Why?

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 group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
        compileOnly group: 'javax.portlet', name: 'portlet-api', version: '2.0'
	compileOnly group: "commons-httpclient", name: "commons-httpclient", version: "3.1"
	compileOnly group: 'org.json', name: 'org.json', version: '2.0'
	compileOnly group: 'org.apache.clerezza.ext', name: 'org.json.simple', version: '0.4'
	compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: '3.1'
	compileOnly group: 'com.liferay.portal', name: 'com.liferay.portal.impl', version: '2.11.0'
	compileOnly group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.6" 

	compileOnly project(":modules:mm-service-builder:mm-service-builder-api")
}

buildService {
	apiDir = "../mm-service-builder-api/src/main/java"
}

group = "mm.service.builder"


Error:

org.osgi.framework.BundleException: Could not resolve module: mm.service.builder.service [648]
  Unresolved requirement: Import-Package: com.liferay.portal.util; version="[1.9.0,2.0.0)"
George Snyder,修改在5 年前。

RE: Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,

New Member 发布: 1 加入日期: 18-11-6 最近的帖子

Perhaps this is not the same issue, but since I came accross this post on my quest for an answer, I want to share that answer in case anyone else also gets here.

 

For me I think I was getting this message because I was using an older version of the gradle plugins for Liferay workspace.  I was using com.liferay:com.liferay.gradle.plugins.workspace version 1.9.0 and net.saliman:gradle-properties-plugin version 1.4.6, then applying both plugins.  I think that was provided as part of a training workspace.  I took those out and added com.liferay:com.liferay.gradle.plugins.workspace version latest.release, and com.liferay:com.liferay.gradle.plugins version 3.12.109, then applied only the com.liferay.workspace plugin.  After that, I no longer had the complaint about javax.portlet [3.0.0,4.0.0) being missing.

 

I think the difference in what was actually produced was that the MANIFEST.MF in the built JAR now has different capabilities.

Sharath Babu A,修改在4 年前。

RE: Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,

Regular Member 帖子: 150 加入日期: 09-5-18 最近的帖子
Hi ,
I am using Liferay Studio. And Liferay-ce-7.2 server. 
And i have created a demo portlet(liferay-mvc-portlet name : DemoModule72). And build successfully.
After deploying it to server, getting below exception.
ERROR [fileinstall-F:/liferay-ce-portal-7.2.0-ga1/osgi/modules][LogService:93] Error while starting bundle: file:/F:/Workspace/Liferay72/Mainwork/eclipse-workspace/FirstLiferay72/modules/DemoModule72/build/libs/DemoModule72-1.0.0.jar 
org.osgi.framework.BundleException: Could not resolve module: DemoModule72 [1072]_  Unresolved requirement: Import-Package: javax.servlet; version="[3.1.0,4.0.0)"_ [Sanitized]
    at org.eclipse.osgi.container.Module.start(Module.java:444)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1264)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1237)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1226)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365)
    at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316)

Is this a problem with 'javax.servlet' version OR problem with gradle version?
thumbnail
Christoph Rabel,修改在4 年前。

RE: Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,

Liferay Legend 帖子: 1554 加入日期: 09-9-24 最近的帖子
Sharath Babu A,修改在4 年前。

RE: Unresolved requirement: Import-Package: javax.portlet; version="[3.0.0,

Regular Member 帖子: 150 加入日期: 09-5-18 最近的帖子
Thanks Christoph Rabel.
keeping  below line in build.gradle solved my issue.

implementation enforcedPlatform(group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1")
Regards,Sharath