cancel
Showing results for 
Search instead for 
Did you mean: 

Exception in UDF GET FILE NAME Dynamic configuration in PI PRD

former_member435556
Participant
0 Kudos
2,540

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 = " " ;

}

}


Accepted Solutions (0)

Answers (3)

Answers (3)

Andrzej_Filusz
Contributor

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

Andrzej_Filusz
Contributor
0 Kudos

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

former_member435556
Participant
0 Kudos

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,

former_member435556
Participant
0 Kudos

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)
Andrzej_Filusz
Contributor
0 Kudos

Hi David,

Please add this check:

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

Best Regards,

Andrzej Filusz

former_member435556
Participant
0 Kudos

Hi Andrej,

Will let you know , please stay connected.

Regards

former_member435556
Participant
0 Kudos

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.

former_member435556
Participant
0 Kudos

Dear Andrzej Filusz,

Your support Required.

pls

former_member207703
Active Participant
0 Kudos

Hi,

Test message in Operational Mapping.

Regards,

Anoop Rai

former_member190293
Active Contributor
0 Kudos

Hi David!

Dynamic Configuration object is not accessible in Message mapping Test.

Try end-to-end testing instead.

Regards, Evgeniy.

former_member435556
Participant
0 Kudos

Hi,

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

Regards,

markangelo_dihiansan
Active Contributor

Hi David,

Is ASMA checked in the file receiver adapter?

Regards,

Mark

former_member435556
Participant
0 Kudos

Yes it already checked