Issue
-
Custom OSGi modules are not deploying with the attached errors
Jan 25 15:31:14.840 build-4 [liferay-6f6445877-9kc6c] [dxp] ERROR [fileinstall-directory-watcher][DirectoryWatcher:1141] Unable to start bundle: file:/opt/liferay/osgi/modules/com.testingmodule.freestyle.api-1.0.0.jar
Jan 25 15:31:14.841 build-4 [liferay-6f6445877-9kc6c] org.osgi.framework.BundleException: Could not resolve module: com.testingmodule.freestyle.api [1822]_ Unresolved requirement: Require-Capability: osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=11))"_ [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:444)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)
at com.liferay.portal.file.install.internal.DirectoryWatcher._startBundle(DirectoryWatcher.java:1124)
at com.liferay.portal.file.install.internal.DirectoryWatcher._startBundles(DirectoryWatcher.java:1157)
at com.liferay.portal.file.install.internal.DirectoryWatcher._process(DirectoryWatcher.java:1019)
at com.liferay.portal.file.install.internal.DirectoryWatcher.run(DirectoryWatcher.java:265)
Jan 25 15:31:14.846 build-4 [liferay-6f6445877-9kc6c] [dxp] ERROR [fileinstall-directory-watcher][DirectoryWatcher:1141] Unable to start bundle: file:/opt/liferay/osgi/modules/com.testingmodule.deploy.service-1.0.0.jar
Jan 25 15:31:14.846 build-4 [liferay-6f6445877-9kc6c] org.osgi.framework.BundleException: Could not resolve module: com.testingmodule.deploy.service [1819]_ Unresolved requirement: Import-Package: com.testingmodule.deploy.model; version="[1.0.0,1.1.0)"_ -> Export-Package: com.testingmodule.deploy.model; bundle-symbolic-name="com.testingmodule.deploy.api"; bundle-version="1.0.0"; version="1.0.0";
Environment
- Liferay PaaS
Resolution
-
The Jenkins image(liferaycloud/jenkins:2.303.2-4.2.5) runs on infra service uses JDK11 by default to build any artifacts and the above error was due to the same. Liferay Cloud team is already released the CI image that uses JDK8 3/8/2022 Service Update 2022.10.1.
However, as a workaround, you may add the following to the liferay/build.gradle to overcome the behavior.
subprojects {
plugins.withType(JavaPlugin) {
compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
}