cancel
Showing results for 
Search instead for 
Did you mean: 

JAVA mapping error: Resource not found: PI 7.5

azharshaikh
Active Contributor
0 Kudos

Hello,

Our requirement is to merge 2 XML files (one input file and one attachment) into 1 file by using JAVA mapping. I am referring blog: http://scn.sap.com/community/pi-and-soa-middleware/blog/2014/06/06/merge-multiple-files-without-bpm

Same JAVA code is written in NWDS. We exported JAR from NWDS and imported it in ESR as IA and used it in operation mapping.

However, we are getting below error in operation mapping testing:

  • Resource not found: META-INF/services/javax.xml.transform.TransformerFactory
  • Resource not found: META-INF/services/javax.xml.parsers.DocumentBuilderFactory

Code is referring below imports:

import java.io.*; 

import java.util.*; 

import javax.xml.parsers.*; 

import javax.xml.transform.*; 

import javax.xml.transform.dom.DOMSource; 

import javax.xml.transform.stream.StreamResult; 

import org.w3c.dom.*; 

import org.xml.sax.SAXException; 

import com.sap.aii.mapping.api.*; 

We tried importing the missing JAR files into NWDS (i.e. with “javax.xml.parsers-1_1.jar.zip” and “javax.xml-1.3.4.jar.zip”) for associated package but this is again not resolving the issue while importing in PI. Also did PI system restart completely after JAR import. But error still persists.

We are on PI 7.5, NWDS 7.5. Please suggest possible reasons and solution for resolving this issue.

Thanks in advance

Azhar

Accepted Solutions (1)

Accepted Solutions (1)

azharshaikh
Active Contributor

Hello All,

Thanks for your inputs. We got the solution. We need to change the attachment name mentioned in the JAVA code by our attachment name and it solved the issue.

Regards,

Azhar

Answers (3)

Answers (3)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Azhar,


We tried importing the missing JAR files into NWDS (i.e. with “javax.xml.parsers-1_1.jar.zip” and “javax.xml-1.3.4.jar.zip”) for associated package but this is again not resolving the issue while importing in PI.

Extract the zip files first and then import the jar files in NWDS. If that does not solve the issue, import the extracted jar files into PI by creating an imported archive.

Regards,

Mark

anupam_ghosh2
Active Contributor
0 Kudos

Hi Azhar,

                  I hope you had following setting while you exported the jar file

Also please ensure that you are compiling the code in java 1.6 . in project build path choose appropriate library.

Thirdly write any other simple java mapping code and check if the same works in PI.

Regards

Anupam

azharshaikh
Active Contributor
0 Kudos

Hi,

Yes, settings are already in place as mentioned. There is no compilation error in NWDS.

Now instead of testing in operation mapping, We developed end to end scenario and tested the same. Error message in message monitoring is different i.e.:

MappingException: Mapping failed in runtimeRuntime Exception when executing application mapping program com/map/Test_JavaClassmultifileMapping; Details: java.lang.NullPointerException; while trying to invoke the method org.w3c.dom.Node.getNodeType() of a null object loaded from local variable source, ApplicationRuntimeException: Runtime Exception when executing application mapping program com/map/Test_JavaClassmultifileMapping; Details: java.lang.NullPointerException; while trying to invoke the method org.w3c.dom.Node.getNodeType() of a null object loaded from local variable source, NullPointerException: while trying to invoke the method org.w3c.dom.Node.getNodeType() of a null object loaded from local variable source”

“Transmitting the message to endpoint <local> using connection SFTP_http://sap.com/xi/XI/SFTP failed, due to: com.sap.aii.af.service.mapping.MappingException: Mapping failed in runtimeRuntime Exception when executing application mapping program com/map/Test_JavaClassmultifileMapping; Details: java.lang.NullPointerException; while trying to invoke the method org.w3c.dom.Node.getNodeType() of a null object loaded from local variable source”

Any idea on this error?


Regards,

Azhar

former_member183816
Active Participant
0 Kudos

Can you show us an example of your input xml to java mapping and code. try to figure out at which node its trying to apply getNodeType() method. may be you are not casting this method correctly.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Azhar,

                Please check the input payload. It seems input payload maybe null or specific node in mapping has a null value.

Can you post the payload and the mapping ???

Regards

Anupam

former_member190293
Active Contributor
0 Kudos

Hi Azhar!

That means that you have getNodeType() method call for object variable that has NULL value.

You should check your java code logic.

Regards, Evgeniy.

former_member183816
Active Participant
0 Kudos

Try to exclude .classpath and .project  files and check "Export generated class files and resources" while exporting your project from NWDS

Are you getting any compilation error or warning while exporting as jar?