Legacy Knowledge Base
Published Jul. 2, 2025

Custom OSGi modules deployment issue

Written By

Sivakumar Perumal

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.
Note: please note that Liferay has renamed its Liferay Experience Could offerings to Liferay SaaS (formerly LXC) and Liferay PaaS (formerly LXC-SM).

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'
    }
    }
    }
Did this article resolve your issue ?

Legacy Knowledge Base