RE: Error Import-Package

Jamie Sammons, modified 3 Years ago. New Member Posts: 10 Join Date: 2/28/23 Recent Posts

I am migrating from Liferay Liferay Digital Experience Platform 7.1.10 GA1 to Liferay Digital Experience Platform 7.4.13 Update 57 from here and trying to deploy a SerchNeorisPortle portlet. I am generating the .jar with gradle.

I am using this version of java to generate the .jar and it is installed in Liferay:

java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)
Those that when lifting are throwing the following error:

ERROR [main][DirectoryWatcher:1176] Unable to start bundle: file:/liferay/osgi/modules/SerchNeorisPortlet-1.0.0.jar
com.liferay.portal.kernel.log.LogSanitizerException: org.osgi.framework.BundleException: Could not resolve module: SerchNeorisPortlet [1824]_  Unresolved requirement: Import-Package: com.liferay.asset.kernel.model; version="[1.4.0,2.0.0)"_ [Sanitized]

thumbnail
Jamie Sammons, modified 3 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts

Your dependencies as listed in the build.gradle file for your module refer to an older version of the package, probably from 7.1.

You need to update your dependencies to target 7.4 bundle 57.

Honestly I'd recommend creating a new workspace for 7.4 U57 and then copy your modules over there. That way you can switch to target platform and the mega jar and ignore all of the individual dependencies and versions. You can do the same with your current workspace, but you have to get all of the properties and versions of the workspace plugins updated first...