前提・実現したいこと
お世話になっております。
現在WEBLOGICサーバーで動作するJAVAのアプリケーションから、バッチファイル(*.cmdファイル。そこにもJAVAのプログラムを
起動している)を起動するプログラムがあり、そこを改修しているのですが、いざテスト環境にて動かすと、処理が固まってしまう・・
という事象が発生して悩んでおります。
改修前は問題なく動作をしておりました。
※サービス起動アカウントの権限不足かと思ったのですが、そこはADMINISTRATORで問題なさそうです。
もしご存知であれば、どのような調査方法があるかご教示いただく事は可能でしょうか?
不足している情報ございましたら、ご指摘をいただけると嬉しいです。
発生している問題・エラーメッセージ
WEBLOGICサーバーにデプロイされた画面アプリから、同じサーバー上のフォルダに格納されている
バッチファイル(*.CMD)を起動し、起動はされるのですが、処理が固まってしまいます。
該当のソースコード
//画面アプリ
logger.debug("出荷指示連携処理 通常出荷 開始");
Runtime rt = Runtime.getRuntime();
Process process0 = rt.exec(new String[]{"cmd", "/c", "d:/IF/CMD/TEST1.CMD", StringUtil.nvl(bean.getCo_no()), "0"}); ←ここで起動
process0.waitFor();
int ret0 = process0.exitValue();
process0.destroy();
logger.debug("出荷指示連携処理 通常出荷 終了 結果[" + String.valueOf(ret0) + "]");
//バッチJAVAプログラム
// 1.5:ログイン通信を行う
WMSLoginRequest loginRequest = new WMSLoginRequest(wmsNinusiCd, wmsUserId, wmsPassword);
ObjectMapper objectMapper = new ObjectMapper();
String body = objectMapper.writeValueAsString(loginRequest);
String json = "{"body":" + body + "}";
logger.info(ctx, "ログイン通信API Request[{}]", json ); ←ここのろぐを吐いたところで固まる。。
PostMethod method = new PostMethod(wmsApiUrl + "Login.json");
method.setRequestHeader("Content-Type", "application/json; charset=UTF-8");
method.setRequestHeader("Referer", refererUrl);
method.setRequestEntity(new InputStreamRequestEntity(new ByteArrayInputStream(json.getBytes("UTF-8"))));
HttpClient client = new HttpClient();
試したこと
サーバーで上記のTEST1.CMDにDOSプロンプトから直接起動をすると、処理は正常終了します。
プログラムでデバッグログの出力しましたが、やはり原因わからず。。
あとJSTACKコマンドで固まった時のスタックトレースを出力しました。
自分が不勉強で申し訳ないのですが、何が悪いのか理解できないでいます。。
Deadlock Detection:
No deadlocks found.
Thread 6: (state = BLOCKED)
Thread 5: (state = BLOCKED)
Thread 4: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Interpreted frame)
- java.lang.ref.ReferenceQueue.remove(long) @bci=44, line=118 (Interpreted frame)
- java.lang.ref.ReferenceQueue.remove() @bci=2, line=134 (Interpreted frame)
- java.lang.ref.Finalizer$FinalizerThread.run() @bci=3, line=159 (Interpreted frame)
Thread 3: (state = BLOCKED)
- java.lang.Object.wait(long) @bci=0 (Interpreted frame)
- java.lang.Object.wait() @bci=2, line=485 (Interpreted frame)
- java.lang.ref.Reference$ReferenceHandler.run() @bci=46, line=116 (Interpreted frame)
Thread 1: (state = IN_NATIVE)
- java.io.FileOutputStream.writeBytes(byte[], int, int) @bci=0 (Interpreted frame)
- java.io.FileOutputStream.write(byte[], int, int) @bci=4, line=282 (Interpreted frame)
- java.io.BufferedOutputStream.write(byte[], int, int) @bci=20, line=105 (Interpreted frame)
- java.io.PrintStream.write(byte[], int, int) @bci=16, line=430 (Interpreted frame)
- org.apache.logging.log4j.core.appender.ConsoleAppender$CloseShieldOutputStream.write(byte[], int, int) @bci=7, line=312 (Interpreted frame)
- org.apache.logging.log4j.core.appender.OutputStreamManager.write(byte[], int, int) @bci=7, line=122 (Interpreted frame)
- org.apache.logging.log4j.core.appender.OutputStreamManager.write(byte[]) @bci=5, line=135 (Interpreted frame)
- org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(org.apache.logging.log4j.core.LogEvent) @bci=30, line=110 (Interpreted frame)
- org.apache.logging.log4j.core.config.AppenderControl.callAppender(org.apache.logging.log4j.core.LogEvent) @bci=250, line=99 (Interpreted frame)
- org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(org.apache.logging.log4j.core.LogEvent) @bci=36, line=430 (Interpreted frame)
- org.apache.logging.log4j.core.config.LoggerConfig.log(org.apache.logging.log4j.core.LogEvent) @bci=91, line=409 (Interpreted frame)
- org.apache.logging.log4j.core.config.LoggerConfig.log(org.apache.logging.log4j.core.LogEvent) @bci=113, line=412 (Interpreted frame)
- org.apache.logging.log4j.core.config.LoggerConfig.log(java.lang.String, java.lang.String, org.apache.logging.log4j.Marker, org.apache.logging.log4j.Level, org.apache.logging.log4j.message.Message, java.lang.Throwable) @bci=167, line=367 (Interpreted frame)
- org.apache.logging.log4j.core.Logger.logMessage(java.lang.String, org.apache.logging.log4j.Level, org.apache.logging.log4j.Marker, org.apache.logging.log4j.message.Message, java.lang.Throwable) @bci=56, line=112 (Interpreted frame)
- org.apache.logging.log4j.spi.AbstractLogger.logMessage(java.lang.String, org.apache.logging.log4j.Level, org.apache.logging.log4j.Marker, java.lang.String, java.lang.Object[]) @bci=28, line=738 (Compiled frame)
- org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(java.lang.String, org.apache.logging.log4j.Level, org.apache.logging.log4j.Marker, java.lang.String, java.lang.Object[]) @bci=21, line=708 (Compiled frame)
- jp.co.tcc.ecs.LogifComm.common.logger.LogifLogger.info(java.util.Map, java.lang.String, java.lang.Object[]) @bci=15, line=4388 (Interpreted frame)
- jp.co.tcc.ecs.LogifBatch.OD310ShipShijiLink.ShipShijiLink.run(java.lang.String[]) @bci=9244, line=1161 (Interpreted frame)
- jp.co.tcc.ecs.LogifBatch.OD310ShipShijiLink.ShipShijiLink.main(java.lang.String[]) @bci=102, line=106 (Interpreted frame)
補足情報(FW/ツールのバージョンなど)
サーバー)
WINDOWS2008 R2
JAVAのバージョン)
1.6.0_39
WEBLOGICのバージョン)
WEBLOGIC11G R1
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/09/20 02:16
2019/09/22 05:41