cancel
Showing results for 
Search instead for 
Did you mean: 

PI 7.01 Java mapping error

RafaelVieira
Active Participant
0 Kudos

Hi all.

I've adjusted a Java code in order to send an XML to customer via email, taking one of the source fields and performing a RFC lookup from ECC retrieving its corresponding email address.


The scenario is an Abap Proxy -> XI -> Email (and RFC lookup).

Running on PI 701 SP 06.
Then, I use the email address and some other fields to fill mail package structure.

Please see attached my java code (used Eclipse to generate it) and then exported into a .jar file, used in an Imported Archive and used it in the Interface Mapping.

My question is:
The scenario is working fine, and the email is being sent as per the need.
Java mapping is being called accordingly, RFC Lookup brings the right values from ERP and everything works perfectly in Dev (for both, PI Interf. Mapping Test tab or end-to-end execution).

When I moved the scenario from Dev to QAS environment, it gives error in the Java code.

The error is:

<Trace
level
="1"
type
="T">RuntimeException during appliction Java
mapping NFE/NFE_Out
</Trace>


<Trace level="1" type="T">java.lang.NullPointerException: while trying to invoke the method
org.w3c.dom.Node.hasChildNodes() of an object loaded from local variable 'node'
at NFE.NFE_Out.execute(NFE_Out.java:150) at
com.sap.aii.ibrun.server.mapping.JavaMapping.executeStep(JavaMapping.java:64) at
com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:92) at
com.sap.aii.ibrun.server.mapping.SequenceMapping.executeStep(SequenceMapping.java:55)
at com.sap.aii.ibrun.server.mapping.Mapping.execute(Mapping.java:92) at
com.sap.aii.ibrun.server.mapping.MappingHandler.run(MappingHandler.java:90) at
com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleMappingRequest(MappingRequestHandler.java:95)
at
com.sap.aii.ibrun.sbeans.mapping.MappingRequestHandler.handleRequest(MappingRequestHandler.java:68)
at
com.sap.aii.ibrun.sbeans.mapping.MappingServiceImpl.processFunction(MappingServiceImpl.java:79)
at
com.sap.aii.ibrun.sbeans.mapping.MappingServiceObjectImpl0_0.processFunction(MappingServiceObjectImpl0_0.java:131)
at sun.reflect.GeneratedMethodAccessor273.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:331) at
com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
at $Proxy344.processFunction(Unknown Source) at
sun.reflect.GeneratedMethodAccessor363.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:331) at
com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:284)
at
com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
at
com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:254)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at
java.security.AccessController.doPrivileged(Native Method) at
com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104) at
com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
</Trace>


<Trace level="1" type="T">Runtime exception occurred during execution of application mapping
program NFE/NFE_Out: java.lang.NullPointerException; while trying to invoke the
method org.w3c.dom.Node.hasChildNodes() of an object loaded from local variable
'node'
</Trace>

Does anyone imagine what I can be doing wrong?
Tks!
Rafael.

Accepted Solutions (1)

Accepted Solutions (1)

former_member193386
Active Contributor
0 Kudos

The error is about the DOM docout, You try to create or append a node in a worng parent node

RafaelVieira
Active Participant
0 Kudos

Hi

former_member181985
Active Contributor
0 Kudos

Check RFC lookup channel in quality. It might be not working and RED.

former_member193386
Active Contributor
0 Kudos

Rafael its a normal case, Your RFC can not return a e-mail or fail during execution like a DUMP ( look at st22 or in you runtime workbanch ).

former_member193386
Active Contributor
0 Kudos

Rafael

I can help you in a NFE sap forum in a portuguese, if you prefer

RafaelVieira
Active Participant
0 Kudos

Although it was under green light in RWB, it was configured pointing to the wrong client in quality system.

Also, there wasn't any treatment for the Selects performed by the lookup, so any error in the selection, returns no record to the mapping and therefore it fails.

Thanks for the great help!

Rafael.

Answers (3)

Answers (3)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Are you using the same business system for both dev and QA? In your condition checking in javalookup mapping you use BS_dev checking for both dev and QA. It should be BS_qas for quality.  PLease see the attached code... as below...

if(senderService.equals(BS_dev)){

    BSystem = "Sys_DEV_ERP_200";

   }else if(senderService.equals(BS_dev)){

     BSystem = "Sys_QAS_ERP_100";

   }else{

    if(senderService.equals(BS_PIDdev)){

     BSystem = "Sys_DEV_ERP_200";

    }

   }

nabendu_sen
Active Contributor
0 Kudos

Hi Rafael,

Your Java code is failing may be for one of the below issues:

1. RFC Lookup is failing. Go to RWB->Component Monitoring->Adapter Monitoring->Communication Channel monitoring, check the status of the RFC Communication Channel.

2. BAPI/Function Module code which is called through RFC at SAP side is not transported from DEV to QAS.

3. Data issue, the value what you are sending to RFC, does not exist at QAS SAP side (Table). Please change the RFC Communication Channel parameter and point it to DEV SAP system and then run the interface. If you find everything is working after that, then must be the issue either Point 2 or Point 3.

former_member181985
Active Contributor
0 Kudos

Can you execute the BAPI in quality SAP back end system using SE37?