가장 간단한 jBilling 예약 플러그인을 개발하는 중 이상한 문제가 있습니다. 매분 실행되는 플러그인을 만들고 싶지만 더 오랜 시간 실행됩니다. 이 방법으로 jBilling이 작동하는 방식을 이해할 수 있었지만 플러그 인의 단일 인스턴스 만 실행하거나 매분마다 새 인스턴스를 시작할 수있었습니다. 그래서 플러그인 (아래 참조)을 작성하고 cron_exp = "* * * * "으로 설치했습니다 (" 0-23 * * *"및 기타 변형). 로그에 jBilling가 시작되면 하지만 지금, 나는 다음과 같은 한 오류 :jBilling scheduled plugin error : pluggable task를 스케쥴하지 못했습니다.
2013-10-28 16:28:26,215 DEBUG [com.sapienter.jbilling.server.pluggableTask.admin.PluggableTaskManager] Applying task com.sapienter.jbilling.server.MyPlugins.testLongTimeRunningPlugin 2013-10-28 16:28:26,217 DEBUG [com.sapienter.jbilling.server.pluggableTask.admin.PluggableTaskManager] Creating a new instance of com.sapienter.jbilling.server.MyPlugins.testLongTimeRunningPlugin 2013-10-28 16:28:26,225 WARN [com.sapienter.jbilling.server.util.Bootstrap] Failed to schedule pluggable task [com.sapienter.jbilling.server.MyPlugins.testLongTimeRunningPlugin] 2013-10-28 16:28:26,225 DEBUG [com.sapienter.jbilling.server.util.Bootstrap] Starting the job scheduler
따라서는 예약 할 수없는 이유를 궁금해하고 내가 그것을 어떻게 해결할 수 있습니까? 다음은 코드입니다, 플러그 인 작업을 Jbilling
public class testLongTimeRunningPlugin extends AbstractCronTask {
public static final String taskName = testLongTimeRunningPlugin.class.getCanonicalName();
private static final Logger LOG = Logger.getLogger(draftAPIgetProductCategories.class);
private static final int time = 5;
@Override
public String getTaskName() {
return taskName;
}
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
LOG.debug("Starting and waiting for " + time + " minutes");
try{
TimeUnit.MINUTES.sleep(time);
LOG.debug("Completed");
}catch (InterruptedException e){
LOG.debug("Interrupted!");
}
}
}
`