Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Dependencies Service Builder Liferay 7.3 GA2
Hello, I´m using Liferay 7.3 GA2, but when I create a service builder give me some problems with dependencies. Can anyone help me with any tip?
org.osgi.framework.BundleException: Could not resolve module: pt.apl.dataservice.service [2282]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[4.1.0,5.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:1297)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1270)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:524)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:369)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:320)
2020-09-18 08:41:17.157 ERROR [fileinstall-C:/workspace/apl/APL-MODULES/apl-workspace/bundles/osgi/modules][LogService:93] Error while starting bundle: file:/C:/workspace/apl/APL-MODULES/apl-workspace/bundles/osgi/modules/pt.apl.dataservice.api.jar
org.osgi.framework.BundleException: Could not resolve module: pt.apl.dataservice.api [2281]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[4.1.0,5.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:1297)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1270)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:524)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:369)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:320)
org.osgi.framework.BundleException: Could not resolve module: pt.apl.dataservice.service [2282]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[4.1.0,5.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:1297)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1270)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:524)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:369)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:320)
2020-09-18 08:41:17.157 ERROR [fileinstall-C:/workspace/apl/APL-MODULES/apl-workspace/bundles/osgi/modules][LogService:93] Error while starting bundle: file:/C:/workspace/apl/APL-MODULES/apl-workspace/bundles/osgi/modules/pt.apl.dataservice.api.jar
org.osgi.framework.BundleException: Could not resolve module: pt.apl.dataservice.api [2281]_ Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[4.1.0,5.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:1297)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1270)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:524)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:369)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:320)
Are you using the target platform or manually specifying dependency versions?
Could you show us your build.gradle files?
Also, could you check the gradle.properties file for a line like this:
liferay.workspace.target.platform.version = 7.3.1
The version there should correspond to the version you use.
Also, could you check the gradle.properties file for a line like this:
liferay.workspace.target.platform.version = 7.3.1
The version there should correspond to the version you use.
Well, I don't quite agree with "The version there should correspond to the version you use."
Since the version from the TP is used as a version range, I feel that you are better off pointing at the GA1 version and get the widest deployment range you can. Picking a later version like GA5 means your code will not run on GA2.
Since the version from the TP is used as a version range, I feel that you are better off pointing at the GA1 version and get the widest deployment range you can. Picking a later version like GA5 means your code will not run on GA2.
David's suggestion is great if you've publishing plugins on the Marketplace, to get the broadest possible adoption.
But if your production is already on GA5 (or you don't yet have production deployed), there's no reason to be compatible with older versions. In fact, I've been bitten with backwards incompatible changes in the past that made me change my default to target the latest release, not the lowest possible.
Another aspect: Especially with the differences between CE GA releases, I think it makes sense to aim at the latest releases. Nobody should stick with the older releases for a long time, but upgrade relatively quickly. And if you're only developing for yourself, you should be safe with the latest version (if you use the latest version)
But in the end it boils down to: Know what and who you're targeting.
But if your production is already on GA5 (or you don't yet have production deployed), there's no reason to be compatible with older versions. In fact, I've been bitten with backwards incompatible changes in the past that made me change my default to target the latest release, not the lowest possible.
Another aspect: Especially with the differences between CE GA releases, I think it makes sense to aim at the latest releases. Nobody should stick with the older releases for a long time, but upgrade relatively quickly. And if you're only developing for yourself, you should be safe with the latest version (if you use the latest version)
But in the end it boils down to: Know what and who you're targeting.
I tried that. Doesn't work. You will probably get several "Unresolved requirement ..." errors since Liferay has bumped the major versions of several packages within 7.3.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™