我创建了 EJB 3 Timer 并将其部署到 weblogic 集群中。createTimer 参数为 createTimer(1000, 20000, null); 这应该每 20 秒创建一次重复计时器。但是计时器总是每 30 秒创建一次。我什至将 intervalDuration 更改为 40 和 50 秒,但超时方法总是每 30 秒触发一次。
以下是 WEBLOGIC_TIMERS 表中的条目 1@@OSBNode2_1355845459844 (BLOB) 1355846770914 1000 TimerearTimerTest.jarTimerTest OSBDomain OSBCluster
Below are the entry from ACTIVE table timer.1@@OSBNode2_1355843156331 -96726833478167425/OSBNode2 OSBDomain OSBCluster 18-DEC-12 service.TimerMaster 8866906753834651127/OSBNode1 OSBDomain OSBCluster 18-DEC-12 service.SINGLETON_MASTER 8866906753834651127/OSBNode1 OSBDomain OSBCluster 18-DEC-12
谁能帮我调查为什么计时器总是每 30 秒触发一次而不是我的 intervalDuration 值?
下面是 EJB ----->>
package com.timertest;
import java.util.*;
import javax.annotation.Resource;
import javax.ejb.*;
@Stateless(mappedName = "TimerTest")
public class TimerTest implements TimerTestRemote
{
@Resource
private SessionContext ctx;
@Override
public void createMyTimer()
throws EJBException
{
ctx.getTimerService().createTimer(1000, 20000, null);
}
@Timeout
public void timeout(Timer timer)
{
System.out.println("-> Timed Out ..."+ new Date());
}
}
Below is the and weblogic descripor-------->>
<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-ejb-jar
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-ejb-jar"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-ejb-jar http://xmlns.oracle.com/weblogic/weblogic-ejb-jar/1.2/weblogic-ejb-jar.xsd">
<wls:weblogic-enterprise-bean>
<wls:ejb-name>TimerTest</wls:ejb-name>
<wls:stateless-session-descriptor>
<wls:stateless-clustering>
<wls:home-is-clusterable>true</wls:home-is-clusterable>
<wls:home-load-algorithm>round-robin</wls:home-load-algorithm>
<wls:stateless-bean-is-clusterable>true</wls:stateless-bean-is-clusterable>
<wls:stateless-bean-load-algorithm>round-robin
</wls:stateless-bean-load-algorithm>
</wls:stateless-clustering>
<wls:business-interface-jndi-name-map>
<wls:business-remote>TimerTestRemote</wls:business-remote>
<wls:jndi-name>TimerTest</wls:jndi-name>
</wls:business-interface-jndi-name-map>
</wls:stateless-session-descriptor>
<wls:enable-call-by-reference>false</wls:enable-call-by-reference>
<wls:jndi-name>TimerTest</wls:jndi-name>
</wls:weblogic-enterprise-bean>
<wls:timer-implementation>Clustered</wls:timer-implementation>
</wls:weblogic-ejb-jar>
提前致谢