Skip to Content
0

Issue with Java mapping(jdk1.4.2) on PI 7.0

Feb 03, 2017 at 03:49 PM

119

avatar image
Former Member

Hi All

Need quick help!! As i need to complete this requirement on priority.

In Java mapping I have included code for Converting input file to Base64,Read Dynamic file name,Map file name to few fields and read Date and convert from YYYYMMDDHHMISS to "YYYY-MM-DDTHH:MI:SS"

I see only one warning "The type StreamTransformation is deprecated"

But as per this link we can still use StreamTransformation. Please help me ..... This is blocking me to test the scenario.

http://help.sap.com/javadocs/pi/sp3/xpi/com/sap/aii/mapping/api/StreamTransformation.html

However I exported with warnings and when I execute the scenarion in interface mapping aswell as in SXMB_MONI I see error.

In MONI:

Java mapping base64/Base64encode has thrown a StreamTransformationException.

In Interface mapping:

Start of test

  • Call method execute of the application Java mapping base64.Base64encode
  • Java mapping base64/Base64encode has thrown a StreamTransformationException.
  • com.sap.aii.mapping.api.StreamTransformationException: java.lang.NullPointerException: while trying to invoke the method java.lang.String.split(java.lang.String) of a null object loaded from local variable 'fileName'

Regards

Anitha

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

11 Answers

Best Answer
avatar image
Former Member Feb 08, 2017 at 04:49 PM
0

Thank you Frederik

Thats correct!! Also I have removed .PDF from file name and I can see message processing successfully.

String date = arr[3].toLowerCase().replaceAll(".pdf","");//It will remove the file extension part from fourth token

Hence closing the thread.

Regards

Anitha

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Feb 03, 2017 at 04:48 PM
0

Hi Anitha!

Did you read my answer in previous thread?

Your fileName variable is null. This means that you didn't get "FileName" attribute from Dynamic Configuration. Did you set required ASMA parameters to store file name to DC in file sender channel?

Error you get doesn't depends on your JRE version.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 03, 2017 at 06:01 PM
0

Hi Evgeniy

I have already checked the File Name box in ASMA parameters of sender file channel.

Please let me know if I missed anything.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 03, 2017 at 06:11 PM
0

Hi Evgeniy

I see in MONI dynamic configuration is performed.

http://schemas.xmlsoap.org/soap/envelope/" xmlns:SAP=" http://sap.com/xi/XI/Message/30"> namespace=" http://sap.com/xi/XI/System/File" name="FileName"> 3003222742_6989_6220860905800023_20170117153350.PDF

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 03, 2017 at 06:20 PM
0

Hi Evgeniy

I think its going wrong here while reading fourth token(date&time) from file name: 3003222742_6989_6220860905800023_20170117153350.PDF

String arr[] = fileName.split("_"); //it will split the string into multiple token
String InvoiceNumber = arr[0]; //it will take the first token
String MerchantNumber = arr[1]; // second token
String CardNumber = arr[2]; //Third token
//String date = arr[3];
Date yourDate = new Date();
SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("YYYY-MM-DDTHH:MI:SS");
String date = DATE_FORMAT.format(yourDate);

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 06, 2017 at 11:23 AM
0

Hi Evgeniy

I think problem is here while reading 4th string(date&time) and converting to required format (YYYY-MM-DDTHH:MI:SS) and omit .pdf from file name.

Please help me to resolve this and correct me if wrong.

Regards

Anitha

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Feb 06, 2017 at 01:32 PM
0

Hi Anitha!

As I could see from error message:

java.lang.NullPointerException: while trying to invoke the method java.lang.String.split(java.lang.String) of a null object loaded from local variable 'fileName'

String.split() method raises exception because 'fileName' variable is null.

You can easily check it up: just comment DC part of your code and set any constant value to fileName variable in your code. If no error is raised - your variable gets wrong value (null) from DC.

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 06, 2017 at 01:46 PM
0

Hi Evgeniy

Sorry the error messages which you see is from Operational mapping(when I tested only mapping).

But in MONI there is no such error and I can see file name in DC of MONI.

so I suspect problem is here while reading 4th string(date&time) and converting to required format (YYYY-MM-DDTHH:MI:SS) and omit .pdf from file name.

Please help me!!

Regards

Anitha

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Feb 06, 2017 at 06:09 PM
0

What is the error messge shown in monitor?

Regards, Evgeniy.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Feb 06, 2017 at 06:38 PM
0

Hi Evgeniy.. Please find attached screen.


1234.png (229.3 kB)
Share
10 |10000 characters needed characters left characters exceeded