我使用「antcall」腳本併發調用,但出現「javax.mail。Management InstanceNotFoundException」。我設置了10個併發,有時可以是10個,有時候只有幾個可以上升。scriptlla併發問題?
<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:類型= ETL,URL = 「文件:/informatica/infa861/oss_etl_523/src/ElectricCable/Pair_Conn.xml」 javax.management.InstanceNotFoundException:scriptella:類型= ETL, URL = 「文件:/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");
}
}
什麼建議給你做這個情況?我應該嘗試什麼,或者我應該閱讀什麼才能找到解決方案?
感謝您的答覆。 – 2013-03-12 05:38:46
順便說一句。這個問題現在應該已經解決了。您可以通過輸入'mvn clean package'或'ant zip',從http://javaforge.com/svn/scriptella構建一個svn版本。 – ejboy 2013-03-12 07:59:02