legacy-knowledge-base
公開されました Jul. 2, 2025

カスタムOSGiモジュールのデプロイメントの問題

投稿者

Sivakumar Perumal

knowledge-article-header-disclaimer-how-to

knowledge-article-header-disclaimer

legacy-article

learn-legacy-article-disclaimer-text

問題

  • カスタムOSGiモジュールがデプロイされず、以下のようなエラーが発生します。
    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 Experience Cloud Self-Managed

解決策

  • infra サービス上で動作する Jenkins イメージ(liferaycloud/jenkins:2.303.2-4.2.5)はデフォルトで JDK11 を使用しており、上記のエラーはこれによるものでした。 Liferay Cloud チームはすでに JDK8 を使用した CI イメージを公開しています 3/8/2022 Service Update 2022.10.1.

    ただし、回避策として、 liferay/build.gradle に以下を追加することで、この挙動を克服することができるかもしれません。

    subprojects {
    plugins.withType(JavaPlugin) {
    compileJava {
    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
    }
    }
    }
did-this-article-resolve-your-issue

legacy-knowledge-base