on 2016 Aug 23 2:40 PM
Hello Expert,
Recently we have upgraded our SAP PI 7.1 [QA environment] system service patch level from SP06 to SP15.
After that we are facing issue with some interface which used JAVA UDFs.
While testing message mapping on ESR level we are getting below error message,
Exception:[java.lang.NullPointerException: while trying to invoke the method java.lang.Object.toString() of an object loaded from local variable '<9>'] in class <InterfaceNampspace here>._ServiceTimeCalculation_to_ServiceTimeCalculationReceive_ method retrieveValues[{088=088, 9130=058, 9940=110, 9170=095, -=, 024=, 023=, 005=05, 080=080, 0003=-, 008=, 069=, 9999=80, 9300=088, 030=, 9001=080, 9000=100, 011=, 013=, 110=110, 095=095, 070=070, 9385=111, 093=, 056=, 073=, 058=, 074=, 092=92}, -I29, ZHR_COMPANY_298, com.sap.aii.mappingtool.tf7.rt.Context@15631f39]
In this message mapping, we have used local variable ZHR_COMPANY and we have used UDF here.
Below is my UDF-
public void StoreValues(String[] key, String[] value, String[] mapName, ResultList result, Container container) throws StreamTransformationException{
GlobalContainer gc;
gc = container.getGlobalContainer();
Map map=new HashMap();
for( int i=0; i<key.length;i++)
{
map.put(key[i],value[i]);
}
String name = mapName[0];
gc.setParameter(name,map);
//AbstractTrace trace = container.getTrace();
//trace.addInfo("Store");
result.addValue(map);
}
Same mapping running successfully on Production environment where Service patch is SP06.
Can someone please guide me, where is the problem?
Regards,
Rohan
Request clarification before answering.
Hi Rohan!
Do you have UDF called "retrieveValues" in your mapping?
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohan,
As Evgeniy already pointed If you read the error properly you know in which method getting the exception.
Exception:[java.lang.NullPointerException: while trying to invoke the method java.lang.Object.toString() of an object loaded from local variable '<9>'] in class <InterfaceNampspace here>._ServiceTimeCalculation_to_ServiceTimeCalculationReceive_ method retrieveValues[{088=088, 9130=058, 9940=110, 9170=095, -=, 024=, 023=, 005=05, 080=080, 0003=-, 008=, 069=, 9999=80, 9300=088, 030=, 9001=080, 9000=100, 011=, 013=, 110=110, 095=095, 070=070, 9385=111, 093=, 056=, 073=, 058=, 074=, 092=92}, -I29, ZHR_COMPANY_298, com.sap.aii.mappingtool.tf7.rt.Context@15631f39]
Can you paste the retrieveValues UDF here??
Regards,
Praveen.
Hello Praveen,
Here is retrieveValues UDF-
public String retrieveValues(String input, String key, String mapName, Container container) throws StreamTransformationException{
GlobalContainer gc = container.getGlobalContainer();
String name = mapName;
Object hMap = gc.getParameter(name);
AbstractTrace trace = container.getTrace();
//trace.addInfo("Retrieve 1 value " + name+ " Map = " + hMap);
Object value = null;
value=((Map)hMap).get(key);
//trace.addInfo("value" +value);
return value.toString() ;
}
-Rohan
Hi Rohan,
Regards,
Praveen.
Also check if you missed any import part?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohan,
This UDF uses global container variables. This variables hold values between mappings during run time. Please run the tests end to end instead of ESR level.
I guess there won't be any errors.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
12 | |
9 | |
8 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.