cancel
Showing results for 
Search instead for 
Did you mean: 

"SYSTEM FAILURE" during JCo call.java.lang.reflect.UndeclaredThrowableExcep

Former Member
0 Kudos

Hi All

I have developed Java mapping program where I am calling three BAPI in sequence and trying to map all three bapi data to single Target XML file or Multiple target xml files depends on the in coming data.

Now I want these files name should be genereted dynamically .So I have used below Dynamic Configuration code in my java mapping program.********************************************************************************************************************************************************************

try

{

String currDate = new String();

String currTime= new String();

DateFormat dFormat=new SimpleDateFormat("yyyyMMdd");

DateFormat tFormat = new SimpleDateFormat("HHmmss");

java.util.Date date = new Date();

TimeZone cetTimeZone = TimeZone.getTimeZone("CET");

tFormat.setTimeZone(cetTimeZone);

currDate = dFormat.format(date);

currTime= tFormat.format(date);

String pubDate=currDate + currTime;

String ext=".xml";

String event="-1_1-";

trace.addInfo("******** Before Dynamic Configuration ***************" );

DynamicConfiguration conf =(DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File","FileName" );

trace.addInfo("******** After Dynamic Configuration ***************" );

String tempFileName="NL09-"eventponum+ "-" pubDateext;

trace.addInfo("The name of the file is : " + tempFileName);

conf.put(key, "tempFileName");

}

catch (Exception e)

{

trace.addWarning("Error While creating File Name"+e.getMessage());

throw new Exception("Error While creating File Name",e);

}

********************************************************************************************************************************************************************************

Now the problem is when I am using above code I am getting following error

"SYSTEM FAILURE" during JCo call.

java.lang.reflect.UndeclaredThrowableException

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="MAPPING">JCO_SYSTEM_FAILURE</SAP:Code>

<SAP:P1>java.lang.reflect.UndeclaredThrowableException</SAP:P1>

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:Stack>&quot;SYSTEM FAILURE&quot; during JCo call.

java.lang.reflect.UndeclaredThrowableException</SAP:Stack>

<SAP:Retry>A</SAP:Retry>

</SAP:Error>

Could please tell me why I am facing this problem only when I am using Dynamic configuration code.

If I dont use Dynamic configuration code then I am not getting any error .But my requirement is to generate dynamic file name (Note I have tried with Variable Substution also, It is also not solving my problem as I need time stamp of ("CET") time zone).

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member200962
Active Contributor
0 Kudos

i think the problem is due to the way you have defined your catch block...while giving the class declaration public void XYZABC have you appended throws StreamTransformationException and imported the relevant StreamTransformationException class....just check

Former Member
0 Kudos

Hi Abhishek,

Yes I have appended throws StreamTransformationException and imported the relevant StreamTransformationException class also.

Here I am getting strange thing when I am adding dynamic configuration code " SYSTEM FAILURE" during JCo call. But Jco cal is something to internal systems which does not relate to Dynamic Configuration.

If I run my code with out any Dynamic Configuration code then it is running with out any errors.

But I need this Dynamic Configuration inorder to generate dyanamic file name.