Message Boards

Dependencies Service Builder Liferay 7.3 GA2

Ciro Rossi, modified 3 Years ago.

Dependencies Service Builder Liferay 7.3 GA2

New Member Posts: 2 Join Date: 3/21/20 Recent Posts
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)
thumbnail
David H Nebinger, modified 3 Years ago.

RE: Dependencies Service Builder Liferay 7.3 GA2

Liferay Legend Posts: 14915 Join Date: 9/2/06 Recent Posts
Are you using the target platform or manually specifying dependency versions?
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Dependencies Service Builder Liferay 7.3 GA2

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts
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.
thumbnail
David H Nebinger, modified 3 Years ago.

RE: Dependencies Service Builder Liferay 7.3 GA2

Liferay Legend Posts: 14915 Join Date: 9/2/06 Recent Posts
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.
thumbnail
Olaf Kock, modified 3 Years ago.

RE: Dependencies Service Builder Liferay 7.3 GA2

Liferay Legend Posts: 6403 Join Date: 9/23/08 Recent Posts
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.
thumbnail
Christoph Rabel, modified 3 Years ago.

RE: Dependencies Service Builder Liferay 7.3 GA2

Liferay Legend Posts: 1554 Join Date: 9/24/09 Recent Posts
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.