简体   繁体   English

在WebLogic上使用应用程序启动TimerService

[英]Start TimerService with application on WebLogic

I'm trying to start an EJB TimerService timer when my application starts on WebLogic 10.3.5 我的应用程序在WebLogic 10.3.5上启动时,我正在尝试启动EJB TimerService计时器。

The Timer is an EJB. 计时器是一个EJB。 I tried using both ServletContextListener and ApplicationLifecycleListener. 我尝试同时使用ServletContextListener和ApplicationLifecycleListener。

Using ServletContextListener results in: 使用ServletContextListener会导致:

Caused By: java.lang.NullPointerException
at weblogic.ejb.container.timer.ClusteredEJBTimerManager.createTimer(ClusteredEJBTimerManager.java:76)
at weblogic.ejb.container.timer.ClusteredEJBTimerManager.createTimer(ClusteredEJBTimerManager.java:95)

When using ApplicationLifecycleListener, I cannot even lookup the EJB. 使用ApplicationLifecycleListener时,我什至无法查找EJB。 However, if I just instantiate it as a POJO, I get an NPE: 但是,如果仅将其实例化为POJO,则会得到一个NPE:

java.lang.NullPointerException
at com.oracle.eas.announcements.deliveryengine.ejb.RecipientsPopulationTimerBean.createTimer(RecipientsPopulationTimerBean.java:77)
at com.oracle.eas.announcements.deliveryengine.listeners.AppStartStopListener.postStart(AppStartStopListener.java:48)

Any advice on how to create a Timer that is created/removed with an Application on WebLogic 10.3.5 would be very much appreciated. 非常感谢任何有关如何创建由WebLogic 10.3.5上的应用程序创建/删除的Timer的建议。

Oracle support have confirmed that this is not possible due to the server state. Oracle支持人员已经确认,由于服务器状态,这是不可能的。

It turns out that my methodology was wrong, I shouldn't need to create a TimerService at each boot, just once and then use it to control Timers subsequently. 事实证明,我的方法是错误的,我不需要在每次启动时都创建一个TimerService,只需创建一次,然后再使用它来控制Timers。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM