When using BW External Command activity to call an OS executable, we are seeing from the output of this activity that some normal debug message are categorized into the Error element.

When using BW External Command activity to call an OS executable, we are seeing from the output of this activity that some normal debug message are categorized into the Error element.

book

Article ID: KB0094528

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
Description:
============

When using BW External Command activity to call an OS executable, we are seeing from the output of this activity that some normal debug message are categorized into the Error element.


Environment:
==========
All

Symptoms:
========

For example, when you execute "java -version" command using external command activity, the output of this activity looks as follows:

<?xml version = "1.0" encoding = "UTF-8"?>
&ltCmdOutputWithActivityOutput xmlns:cmd = "http://www.tibco.com/cmdexec">
    &ltreturnCode&gt0</returnCode>
    &ltoutput/>
    &lterror&gtjava version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode)
    </error>
</CmdOutputWithActivityOutput>

Apparently the output of java -version is being placed into the error schema.

Cause:
=====
Internally BW uses the Java API Runtime.exec() to execute command. The result of this API invocation contains both the standard output stream and standard error stream. The output and error schema will fetch from the output stream and error stream respectively. Consequently, the cause of this issue relies on the JAVA API Runtime.exec() itself.


Resolution:
==========
Make use of the output of the external command activity. Check the  contents of the error element and determine whether the external command call throws exceptions.

Considering that whether the execution result of some commands will direct to stderr or stdout is unknown it is suggested to avoid using the “external command” in such a way.

Attachments:
===========
CommandLineTest2.java -- This is a plain Java source code which execute command "java -version" and print out the stderr as well as stdout.

Issue/Introduction

When using BW External Command activity to call an OS executable, we are seeing from the output of this activity that some normal debug message are categorized into the Error element.

Attachments

When using BW External Command activity to call an OS executable, we are seeing from the output of this activity that some normal debug message are categorized into the Error element. get_app