7.4 U62からU90にアップグレード後、カスタムスケジューラが動作しない
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にアップデートしたら動作しなくなりました。
解像度
LPS-176754 による変更のため、7.4 U90 で動作するようにコードを修正してください。 以下に、コードを適応する際のガイドラインを示す。 これにはカスタマイズが含まれるため、Liferayサポートがお手伝いできることは限られています。 Liferayグローバルサービスチームからのサポートが必要な場合は、担当営業までお気軽にお問い合わせください。
以前のコードと現在のコードを比較し、必要な変更を加えることができる。
- 前のコード - 現在のコード 2. xxxMessageListener.java を xxxSchedulerJobConfiguration.javaに置き換える方法。
ステップ 1 - 古いファイルをコピーする xxxMessageListener.java ファイルを xxx/internal/scheduler フォルダー にコピーする 例えば、 SyncMaintenanceMessageListener.java は com/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