Skip to Content
0

Exception in UDF GET FILE NAME Dynamic configuration in PI PRD

Mar 13 at 07:48 AM

99

avatar image
Former Member

Hi guys,

Recently we upgraded our PI system from 7.0 to 7.5 (dual split) we have been using UDF Dynamic file configuration java function to get the filename from ftp from one of our scenario, it was working perfectly fine before upgrade but now giving exception just PRD, while it is running fine in Qas. its giving exception in both end to end scenerio or mapping testing.

please guide me as i am already search on Scn but didn't find a solution

Code of UDF and screenshots are attached for reference please.

public String getFileName(Container container) throws StreamTransformationException

{

String fname = "";

Try

{

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

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

fname = conf1.get(key1);

conf1.put(key1,fname);

}

catch(Exception ee)

{

fname = " " ;

}

}


udf.png (303.4 kB)
udf2.png (99.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Andrzej Filusz Mar 14 at 01:36 PM
1

Hi David,

I have to admit I don't understand the logic in your UDF. You read a value from the configuration in one line and then you put it back without any modification in the next line. Why? And the most important problem is that there is no "return" statement in your code. You shouldn't be able to compile it. So how is it possible that this code works on your test environment? Are you sure that's the correct code?

Best Regards,

Andrzej Filusz

Show 7 Share
10 |10000 characters needed characters left characters exceeded

Hi David,

Could you please replace this line:

fname = conf1.get(key1);

with the following one:

fname = "" + conf1.get(key1);

Could you also add the screen-shot of the "Advanced" tab of your CC?

Best regards,

Andrzej Filusz

0
Former Member

Dear Andrzej,

Thanks for reviewing my code, As I mentioned i put try and catch block after upgrade as it was giving mapping error on sxmb_moni right after upgrade same code was working fine before upgrade,

Below is the code was working fine before upgrade and after upgrade giving mapping excpetion on test as well as end to end testing.

String fname = "";

DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName"); fname = conf1.get(key1);

conf1.put(key1,fname);

return fname;

Please Guide me.

Regards,

udf.png (27.7 kB)
asma.png (13.5 kB)
0
Former Member
Former Member

I have changed the code as you said but same error on mapping test.

  • Exception:[java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.get(com.sap.aii.mapping.api.DynamicConfigurationKey) of a null object loaded from a local variable at slot 3] in class com.sap.xi.tf._ZCITI_MM_FILE_ACK_ method getFileName[com.sap.aii.mappingtool.tf7.rt.Context@6f7b0bf6]
  • com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.get(com.sap.aii.mapping.api.DynamicConfigurationKey) of a null object loaded from a local variable at slot 3] in class com.sap.xi.tf._ZCITI_MM_FILE_ACK_ method getFileName[com.sap.aii.mappingtool.tf7.rt.Context@6f7b0bf6]
  • at com.sap.aii.mappingtool.tf7.rt.MethodImplementedIteratorHelper.executeMethod(MethodImplementedIteratorHelper.java:188)
0

Hi David,

Please add this check:

if (conf1 != null) {
   fname = conf1.get(key1);
   conf1.put(key1,fname);
}

Best Regards,

Andrzej Filusz

0
Former Member
Andrzej Filusz

Hi Andrej,

Will let you know , please stay connected.

Regards

0
Former Member

Dear Andrej,

After adding the above mentioned check. when i test end to end scenario i am having the mapping error in sxmb_moni.

Mapping error Exception.

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<!-- Request Message Mapping -->
-<SAP:Error xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP="http://sap.com/xi/XI/Message/30" SOAP:mustUnderstand="1">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>com/sap/xi/tf/_MP_SCB_</SAP:P1>
<SAP:P2>com.sap.aii.mappingtool.tf7.MessageMappingExceptio</SAP:P2>
<SAP:P3>n: Runtime exception when processing target-field</SAP:P3>
<SAP:P4>mapping /ns1:YPTCL_BPS_ACK_TRANS/FNAME; root mess~</SAP:P4>
<SAP:AdditionalText/>
<SAP:Stack>A runtime exception was raised in the application mapping com/sap/xi/tf/_MP_SCB_; com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-fieldmapping /ns1:YPTCL_BPS_ACK_TRANS/FNAME; root mess~ </SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>

its the same error when i added the try catch block in the code after Pi upgrade.

Please guide.

error-moni2.png (20.1 kB)
moni-error.png (8.9 kB)
0
Former Member

Dear Andrzej Filusz,

Your support Required.

pls

0
Evgeniy Kolmakov Mar 13 at 08:08 AM
0

Hi David!

Dynamic Configuration object is not accessible in Message mapping Test.

Try end-to-end testing instead.

Regards, Evgeniy.

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi,

I already mentioned that is also giving exception in end to end testing.

Regards,

0

Hi David,

Is ASMA checked in the file receiver adapter?

Regards,

Mark

1
Former Member

Yes it already checked

0
avatar image
Former Member Mar 16 at 12:45 PM
0

Hi,

Test message in Operational Mapping.

Regards,

Anoop Rai

Share
10 |10000 characters needed characters left characters exceeded