legacy-knowledge-base
公開されました Sep. 10, 2025

7.4 U62からU90にアップグレード後、カスタムスケジューラが動作しない

written-by

Laura Li

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

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

legacy-article

learn-legacy-article-disclaimer-text

問題

  • 私たちは7.4 U62で完璧に動作するスケジューラを書きましたが、バンドルを7.4 U90にアップデートしたら動作しなくなりました。

環境

  • Liferay DXP 7.4

解像度

  • LPS-176754 による変更のため、7.4 U90 で動作するようにコードを修正してください。 以下に、コードを適応する際のガイドラインを示す。 これにはカスタマイズが含まれるため、Liferayサポートがお手伝いできることは限られています。 Liferayグローバルサービスチームからのサポートが必要な場合は、担当営業までお気軽にお問い合わせください。
    1. 以前のコードと現在のコードを比較し、必要な変更を加えることができる。

    - 前のコード
    - 現在のコード

    2. xxxMessageListener.javaxxxSchedulerJobConfiguration.javaに置き換える方法。


    ステップ 1 - 古いファイルをコピーする
    xxxMessageListener.java ファイルを xxx/internal/scheduler フォルダー
    にコピーする 例えば、 SyncMaintenanceMessageListener.javacom/liferay/sync/internal/messaging/ から com/liferay/sync/internal/scheduler/

    に移動します。 ステップ 2 - 古いファイルの名前を変更する
    xxxMessageListener.java ファイルの名前を xxxSchedulerJobConfiguration.java
    例えば SyncMaintenanceMessageListener.java から SyncMaintenanceSchedulerJobConfiguration.java

    ステップ 3 - ファイルのパッケージを変更する
    package com.liferay.xxx.internal.messaging;package com.liferay.xxx.internal.scheduler; に変更します。scheduler;
    例えば、 package com.liferay.sync.internal.messaging; から package com.liferay.sync.internal.scheduler;

    Step 4 - @Component アノテーションを追加する
    古いアノテーションを削除する。 新しいものを追加します:
    @Component(service = SchedulerJobConfiguration.class)

    ステップ5 - SchedulerJobConfigurationインターフェースのインポートと実装
    import com.liferay.portal.kernel.scheduler.SchedulerJobConfiguration; 行を追加します。SchedulerJobConfiguration;
    あなたの xxxSchedulerJobConfiguration implements SchedulerJobConfiguration
    例えば、 public class SyncMaintenanceSchedulerJobConfiguration
    implements SchedulerJobConfiguration {

    ステップ6 - オーバーライド UnsafeRunnable
    クラスをインポートします:
    import com.liferay.petra.function.UnsafeRunnable;
    メソッドをオーバーライドします:

    public UnsafeRunnable<Exception> getJobExecutor() {

    ステップ7 - オーバーライド TriggerConfiguration
    クラスをインポートする:
    import com.liferay.portal.kernel.scheduler.TriggerConfiguration;
    メソッドをオーバーライドする:

    public TriggerConfiguration getTriggerConfiguration() {

    ステップ8 - activate メソッドを修正
    ConfigurableUtil メソッドのみを含むようにメソッドを修正します。 例えば

    protected void activate(Map<String, Object> properties) {
    _assetPublisherWebConfiguration = ConfigurableUtil.createConfigurable(
    AssetPublisherWebConfiguration.class, properties);
    }.

    ステップ 9 - 未使用のクラスとそのインポートを削除する

    import com.liferay.portal.kernel.messaging.BaseMessageListener;
    import com.liferay.portal.kernel.messaging.DestinationNames;
    import com.liferay.portal.kernel.messaging.Message;
    import com.liferay.portal.kernel.scheduler.SchedulerEngineHelper;
    import com.liferay.portal.kernel.scheduler.SchedulerEntry;
    import com.liferay.portal.kernel.scheduler.SchedulerEntryImpl;
    import com.liferay.portal.kernel.scheduler.Trigger;
    import com.liferay.portal.kernel.scheduler.TriggerFactory;

    Step 10 - 削除 xxxMessageListener.java ファイル

did-this-article-resolve-your-issue

legacy-knowledge-base