cancel
Showing results for 
Search instead for 
Did you mean: 

MP: exception caught with cause com.sap.engine.services.jndi.persistent.exceptions720.NameNotFoundException: Object not found in lookup of EDIDataSplitChar.

former_member213558
Active Participant
0 Kudos

Hi All.

I've deployed a custom module from NWDS7.31 to SAP PO 7.4 as mentioned below.

and i've mentioned the module name in receiver file adapter channel as mentioned below

while processing i'm getting an below error

please note:

1. if i change the module name as "lacalejbs/EDIDataSplitChar" also i'm facing the above same error.

2. if i change the module name as "AF_Modules/EDIDataSplitChar" also i'm facing the below (similar) error.

3. for deploying the module I referred  the blog

please suggest how to fix this error.

Regards

Ramesh

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member213558
Active Participant
0 Kudos

Hi All.

Please note:

I've not followed the exact requirement of http://scn.sap.com/community/pi-and-soa-middleware/blog/2014/08/08/pi-74--adapter-module-creation-us...  this blog.

my requirement: Receiver File channel receive the EDI file which contain raw edi data format, Each line of the data can have more then 80 character  as well as multiple line also comes. so i need to split the line based on my  parameter value. i.e if i give parameter value as 80, each line of the data must be 80 character.

so i suggested to write a code to my java team. as they does't know how the input stream comes at run time, then they decided to check test scenario.i.e when ever the EDI data receives the channel, this (EDIDataSplitChar) module have to replace the whole EDI data as a "hello". if this testing works fine then java team can go further as per my requirement.


for your better analysis i can add the code here.


1. Class name:      EDIDataSplitChar.java)

package com.sap.modules;

import java.io.ByteArrayOutputStream;

import java.io.InputStream;

import javax.ejb.Stateless;

import javax.xml.parsers.DocumentBuilder;

import javax.xml.parsers.DocumentBuilderFactory;

import javax.xml.transform.Result;

import javax.xml.transform.Source;

import javax.xml.transform.Transformer;

import javax.xml.transform.TransformerFactory;

import javax.xml.transform.dom.DOMSource;

import javax.xml.transform.stream.StreamResult;

import org.w3c.dom.Document;

import com.sap.aii.af.lib.mp.module.Module;

import com.sap.aii.af.lib.mp.module.ModuleContext;

import com.sap.aii.af.lib.mp.module.ModuleData;

import com.sap.aii.af.lib.mp.module.ModuleException;

import com.sap.engine.interfaces.messaging.api.Message;

import com.sap.engine.interfaces.messaging.api.MessageKey;

import com.sap.tc.logging.Location;

/**

* Session Bean implementation class EDIDataSplitChar

*/

@Stateless

public class EDIDataSplitChar implements EDIDataSplitCharRemote, EDIDataSplitCharLocal, Module {

    /**

     * Default constructor.

     */

    public EDIDataSplitChar() {

        // TODO Auto-generated constructor stub

//     process(ModuleContext.class, ModuleData.class);

    }

   

    public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException

    {

    try

    {

    Location myLoc = Location.getLocation(EDIDataSplitChar.class);

       myLoc.infoT("In process method");

//     String SIGNATURE = "process(ModuleContext moduleContext, ModuleData inputModuleData)";

    Object obj = null;

       Message msg = null;

       MessageKey amk = null;

      

  

      

       obj = inputModuleData.getPrincipalData();

       msg = (Message) obj;

       amk = new MessageKey(msg.getMessageId(),msg.getMessageDirection());

      

       com.sap.engine.interfaces.messaging.api.Payload payLoad = msg.getMainPayload();

      

       DocumentBuilderFactory factory;

       factory = DocumentBuilderFactory.newInstance();

       DocumentBuilder builder = factory.newDocumentBuilder();

       Document document = builder.parse((InputStream) payLoad.getInputStream());

//        Element rootNode = document.getDocumentElement();

      

       document.setTextContent("hello");

      

       TransformerFactory tfactory = TransformerFactory.newInstance();

       Transformer transformer = tfactory.newTransformer();

       Source src = new DOMSource(document);

       ByteArrayOutputStream myBytes = new ByteArrayOutputStream();

       Result dest = new StreamResult(myBytes);

       transformer.transform(src,dest);

       byte[] docContent = myBytes.toByteArray();

      

       payLoad.setContent(docContent);

       inputModuleData.setPrincipalData(msg);

    }

    catch (Exception e)

    {

  }

    finally

    {

    return inputModuleData;

    }

    }

}

2. local. EDIDataSplitCharLocal.java

package com.sap.modules;

import javax.ejb.Local;

import com.sap.aii.af.lib.mp.module.ModuleContext;

import com.sap.aii.af.lib.mp.module.ModuleData;

import com.sap.aii.af.lib.mp.module.ModuleException;

@Local

public interface EDIDataSplitCharLocal {

  public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException;

}

3. remote: EDIDataSplitCharRemote.java

package com.sap.modules;

import javax.ejb.Remote;

import com.sap.aii.af.lib.mp.module.ModuleContext;

import com.sap.aii.af.lib.mp.module.ModuleData;

import com.sap.aii.af.lib.mp.module.ModuleException;

@Remote

public interface EDIDataSplitCharRemote {

  public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException;

}

Best Regards.

Ramesh

former_member186851
Active Contributor
0 Kudos

Ramesh,

Just cross check whether you have configured everything as per the below link

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e674...

former_member213558
Active Participant
0 Kudos

HI raghuraman.

Thank you for your reply.

suggested blog's scenario is done by NWDS 7.1 for SAP PI 7.1, but i trying with NWDS 7.31 to SAP PO 7.4.  and i referred this blog

to achieve this requirement. please do needful. i'll try to create one more project which you suggest blog.

Regards

Ramesh

former_member186851
Active Contributor
0 Kudos


Ok Ramesh,

But am not seeing any mistake in yours,I thought JNDI name is wrong.But tested chaning the same as well.

Anyways lets wait for other experts replies.

vicky20691
Active Contributor
0 Kudos

Hi Ramesh,

In channel you need to give the module name as

localejbs/<JNDI Name>

I can see the JNDI Name of your module is sap.com/EDIDataSplitEAR/EDIDataSplitChar

in channel try module name as localejbs/sap.com/EDIDataSplitEAR/EDIDataSplitChar

Regards,

Vikas

engswee
Active Contributor
0 Kudos

Vikas' answer is correct.

Just to add on

1. The localejbs/ prefix is optional.

2. The name you put in the module chain should match the name listed in <jndi-name> of the deployment descriptor file ejb-j2ee-engine.xml in your EJB project.

former_member213558
Active Participant
0 Kudos

Hi Vikas. I've changed the JNDI name as mentioed below and in channel level i tried both localejbs/ and only JNDI name, but i can see the same error. please do needful.

Thank you for your reply

former_member213558
Active Participant
0 Kudos

Hi Eng Swee Yeoh.

Thank you for your reply.

in channel level I've maintained the same value which is maintained in ejb-j2ee-engine.xml  file.

fyr please find the screenshot below.

please suggests further.

former_member182412
Active Contributor
0 Kudos

Hi Ramesh,

can you search the module in JNDI browser in NWA like below.

Regards,

Praveen.

former_member213558
Active Participant
0 Kudos

Hi Paveen.

No.. it's not available.

Thank you for your reply

Regards

ramesh

former_member182412
Active Contributor
0 Kudos

Hi Ramesh,

Can you search your module not the name which i show you in the screen shot, i just shown my custom adapter module for example.

Your adapter module must be there in the JNDI browser if not then the module not deployed properly because at runtime system look in JNDI browser for the name specified in the channel .

Regards,
Praveen.

former_member213558
Active Participant
0 Kudos

Hi Praveen.

Yes I Can see as mentioned below.

former_member213558
Active Participant
0 Kudos

Hi Praveen.

fyr Please note I can see some context name as well as mentioned below.

former_member186851
Active Contributor
0 Kudos

Hello Ramesh,

Make sure your module is deployed and exact name should be used in channel.

former_member213558
Active Participant
0 Kudos

Hi Raghuraman. I've deployed successfully without an any error. and i can see in Application module as well in NWA.

former_member213558
Active Participant
0 Kudos

Hi Raghuraraman.

please find the screenshot of the module which is deployed. 

Regards

ramesh

former_member186851
Active Contributor
0 Kudos

Ramesh,

Try with this name -EDIDataSplit

former_member213558
Active Participant
0 Kudos

HiRaghuram. I tried but i can see the same error, please suggest further. Thank you for your reply.