Liferay 7.1 CE GA1: Start of module fails because of unresolved requirement

Marcus Hiebenga, modified 7 Years ago. New Member Posts: 20 Join Date: 1/11/17 Recent Posts

Hello,

I try to install a service but it gives me following error (blade):

 

965|Active    | 10|Liferay Chat API (2.0.9)
967|Installed | 10|Liferay Chat Service (2.0.9) 
D:\>blade sh start 967 

start 967 org.osgi.framework.BundleException: Could not resolve module: com.liferay.chat.service [967] 
  Unresolved requirement: Import-Package: com.liferay.portal.upgrade.registry; version="[1.2.0,2.0.0)"

 

My build.gradle looks like this:

buildService {
	apiDir = "../chat-api/src/main/java"
	testDir = "../chat-test/src/testIntegration/java"
}

repositories {
	maven { url property('de.convergys.nexus.releaseRepo') }
	maven { url property('de.convergys.nexus.snapshotRepo') }
	maven { url property('de.convergys.url.repository.plugins') }
}

dependencies {
	compile group: "com.liferay", name: "com.liferay.portal.upgrade", version: "2.3.0"

	provided group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
	provided group: "com.liferay", name: "com.liferay.portal.configuration.metatype", version: "2.0.0"
	provided group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.0"
	provided group: "com.liferay", name: "com.liferay.portal.profile", version: "1.0.0"
	provided group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.0.0"
	provided group: 'com.liferay', name: 'com.liferay.petra.string', version: '2.0.1'
	provided group: "com.liferay.portal", name: "com.liferay.portal.impl", version: "3.0.0"
	provided group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "3.0.0"
	provided group: "javax.portlet", name: "portlet-api", version: "2.0"
	provided group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
	provided group: "org.osgi", name: "org.osgi.service.component", version: "1.3.0"
	provided group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"

	compileInclude group: 'com.neovisionaries', name: 'nv-websocket-client', version: '2.4'

	provided project(":modules:de.convergys.liferay.servicebuilder.liferay-chat:chat-api")
}

liferay {
	deployDir = file(project.property('de.convergys.server.currentpath') + '/deploy')
}

 

I don't understand what is missing. "com.liferay.portal.upgrade.registry" should be included in "com.liferay.portal.upgrade". I tried different versions of "com.liferay.portal.upgrade", but nothing worked.

I added the jar-files so you can reproduce the error.

 

I need help.

 

Best regards

Marcus

thumbnail
David H Nebinger, modified 7 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts

You're mixing versions from Liferay 7.0 and 7.1 somewhere.  You have a direct dependency on 2.3.0 (from your first declared dependency) which would be 7.1 (as your other deps imply), but one of your other deps has a transitive dependency on com.liferay.portal.upgrade from 7.0.

Your issue is not that you have to change your build.gradle, that is not the problem.  The OSGi runtime is telling you that there is no Liferay 7.0 version of com.liferay.portal.upgrade available in the container to inject into your component.

thumbnail
Minhchau Dang, modified 7 Years ago. Liferay Master Posts: 598 Join Date: 10/22/07 Recent Posts
Marcus Hiebenga:
compile group: "com.liferay", name: "com.liferay.portal.upgrade", version: "2.3.0"

Some time between 7.0.4 GA5 and 7.0.5 GA6 (specifically LPS-77397), Liferay split the com.liferay.portal.upgrade artifact into two separate artifacts: com.liferay.portal.upgrade.api and com.liferay.portal.upgrade.impl.

Try changing your dependency to the following:

compile group: "com.liferay", name: "com.liferay.portal.upgrade.api", version: "2.0.0"
Marcus Hiebenga, modified 7 Years ago. New Member Posts: 20 Join Date: 1/11/17 Recent Posts

Thank you for your help. Worked perfectly.