我使用“antcall” scriptlla 并发调用,但出现“javax.mail.Management InstanceNotFoundException”。我设置了10个并发,有时可以10个,有时只能升几个。
<target name="PAIR_CONN">
<etl debug="true">
<fileset file="Pair_Conn.xml" />
</etl>
</target>
<target name="pair_conn_mult">
<parallel threadCount='5'>
<antcall target="PAIR_CONN">
<param name="g_flag" value="1" />
</antcall>
<antcall target="PAIR_CONN">
<param name="g_flag" value="2" />
</antcall>
<antcall target="PAIR_CONN">
<param name="g_flag" value="3" />
</antcall>
<antcall target="PAIR_CONN">
<param name="g_flag" value="4" />
</antcall>
<antcall target="PAIR_CONN">
<param name="g_flag" value="0" />
</antcall>
</parallel>
</target>
无法注销 mbean scriptella:type=etl,url="file:/informatica/infa861/oss_etl_523/src/ElectricCable/Pair_Conn.xml" javax.management.InstanceNotFoundException: scriptella:type=etl,url="file:/informatica/ infa861/oss_etl_523/src/ElectricCable/Pair_Conn.xml"
我查看scriptella源码,代码已经同步了,
public synchronized void register() {
if (name != null) {
throw new IllegalStateException("MBean already registered");
}
server = getMBeanServer();
String url = ctx.getScriptFileURL().toString();
System.out.println("LM:"+url);
boolean registered = false;
for (int i = 0; i < 1000; i++) {
if (name == null || server.isRegistered(name)) {
registered = true;
name = toObjectName(url, i);
System.out.println("LM:"+name);
} else {
registered = false;
break;
}
}
etlThread = Thread.currentThread();
if (!registered) {
try {
server.registerMBean(this, name);
started = new Date();
LOG.info("Registered JMX mbean: " + name);
} catch (Exception e) {
throw new SystemException("Unable to register mbean " + name, e);
}
} else {
throw new SystemException("Unable to register mbean for url " + url + ": too many equal tasks already registered");
}
}
对于这种情况,您有什么建议?我应该尝试什么,或者我应该阅读什么才能找到解决方案?