Customer adapter module

I'm developing one customer adapter module that calls stored procedure on sender side. I'm not able to stop process when Resultset is empty. As interface is firing every 60s, it is happening quite often and I want to avoid this, like std. JDBC adapter does. How to get this?
kr
mario
p.s: there should be some documentation on PI server regarding development customer modules, and I've found ONLY compiled Java classes not the source code. Any idea?

Mario,
Its Adapter that calls the Module and it is not true other way around so you can't stop adapter through Module.
In your module code you can write a code in such a way that it forms just a header(or anything you wish to) and send it further.
In Receiver determination you can put a condition if certain node doesn't exist (in case of Result Set returns empty) then End the message (with or without error notification).
Thanks,
Sunil Singh

Similar Messages

  • SAP PI crashes because of Custom Adapter module

    Hi,
    We are facing a strange problem. We have deployed a custom adapter module developed in java which accesses a Hardware Security Module(HSM) and uses the keys in HSM to digitally sign our data. Now, when I use particular methods in this code and deploy it on PI server, the server crashes while testing this out. As soon as I run the channel having this adapter module, PI server becomes unavailable. It restarts on its own after a few minutes.
    One of the reasons I identified to be causing this issue is the signing mechanism used in code. When I used a mechanism that was not supported or not correct, it crashed the server. If i corrected it, it worked fine. I found no other thing in my code causing this behaviour apart from this mechanism. But I am still not able to understand how a single method in a code can cause the whole server to crash. Has anybody here faced such a problem? Any pointers would be appreciated.
    We are using SAP PI 7.31 java only installation.
    Thanks,
    Ravi Desai

    Hi Ravi
    1. To check if it is a memory issue. Once you start the channel, check the memory usage in nwa. Check if the memory is increasing once the channel is started.
    2. Add debug statements to print logs in default traces at as many places as possible. Since your code is not reaching the Catch block, using the debug statement you can reach the line in the code which is causing this issue.
    Regards
    Osman Jabri

  • Unable to deploy custom adapter module in PI 7.31

    Hi pros,
    I created a custom adapter module to split some complex input files to multiple messages. We use a SAP PO 7.31 java-only installation. I followed this document to create my adapter module:
    How to Create Modules for the JEE Adapter Engine
    I know it is for PI 7.1 but a colleague of mine said that he was able to create a running adapter module for PI 7.3 following the guide. I created the following projects:
    EAR project references the EJB project:
    Project facet of the EJBproject:
    ejb-jar.xml config:
    application-j2ee-engine.xml (in EAR project):
    When I try to deploy my module, I get the following error:
    Java version:
    NWDS version:
    Any hint is appreciated! What can be wrong? What can I check again?
    THANKS!
    Message was edited by: Stefan Münchow

    I am not sure if the version is the problem. We have PI 7.31, support package 14, patch level 0 and NWDS 7.31 support package 12, patch level 4. The version of NWDS is lower than the version of the PI. According to Note 1599298 the error occurs when the NWDS is higher than the one of PI. Besides, we are able to deploy BPMN processes with the same NWDS to the same server.
    This is the exact exception trace shown in NWDS:
    com.sap.ide.eclipse.sdm.deploy.DeploymentException: [ERROR CODE DPL.DCAPI.1027] DeploymentException.
    Reason: ASJ.dpl_dc.001085 Operation [deploy] of [sap.com_SplitArticleFileModule_EAR] failed
    at com.sap.ide.eclipse.sdm.threading.DCDeployThread.run(DCDeployThread.java:110)
    ------------- Nested exception -------------------
    com.sap.engine.services.dc.api.deploy.DeployException: [ERROR CODE DPL.DCAPI.1027] DeploymentException.
    Reason: ASJ.dpl_dc.001085 Operation [deploy] of [sap.com_SplitArticleFileModule_EAR] failed
    at com.sap.engine.services.dc.api.deploy.impl.DeployProcessorImpl.deployItems(DeployProcessorImpl.java:862)
    at com.sap.engine.services.dc.api.deploy.impl.DeployProcessorImpl.deploy(DeployProcessorImpl.java:259)
    at com.sap.ide.eclipse.deployer.dc.deploy.DeployProcessor70.deploy(DeployProcessor70.java:105)
    at com.sap.ide.eclipse.sdm.threading.DCDeployThread.run(DCDeployThread.java:80)
    Caused by: com.sap.engine.services.dc.cm.deploy.DeploymentException: ASJ.dpl_dc.001085 Operation [deploy] of [sap.com_SplitArticleFileModule_EAR] failed
    at com.sap.engine.services.dc.cm.deploy.impl.OnlineDeployProcessor.performDelivery(OnlineDeployProcessor.java:246)
    at com.sap.engine.services.dc.cm.deploy.impl.BulkOnlineDeployProcessor.deploy(BulkOnlineDeployProcessor.java:67)
    at com.sap.engine.services.dc.cm.deploy.impl.AbstractDeployProcessor$DeployProcessorHelper.visit(AbstractDeployProcessor.java:282)
    at com.sap.engine.services.dc.cm.deploy.impl.DeploymentItemImpl.accept(DeploymentItemImpl.java:84)
    at com.sap.engine.services.dc.cm.deploy.impl.AbstractDeployProcessor.deploy(AbstractDeployProcessor.java:100)
    at com.sap.engine.services.dc.cm.deploy.impl.DeployThread.run(DeployThread.java:39)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)
    at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)
    at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)
    Caused by: com.sap.engine.services.dc.gd.DeliveryException: [ERROR CODE DPL.DC.3298] Operation [deploy] of [sap.com_SplitArticleFileModule_EAR] failed
    at com.sap.engine.services.dc.gd.impl.ApplicationDeployer.deploy(ApplicationDeployer.java:167)
    at com.sap.engine.services.dc.gd.impl.InitialApplicationDeployer.performDeployment(InitialApplicationDeployer.java:138)
    at com.sap.engine.services.dc.gd.impl.InitialGenericDeliveryImpl.deploy(InitialGenericDeliveryImpl.java:57)
    at com.sap.engine.services.dc.cm.deploy.impl.OnlineDeployProcessor.performDelivery(OnlineDeployProcessor.java:213)
    ... 8 more
    Caused by: com.sap.engine.services.deploy.server.utils.DSRemoteException: ASJ.dpl_ds.006193 Operation [deploy] of [/usr/sap/DP2/J64/j2ee/cluster/server0/temp/tc~bl~deploy_controller/archives/213/SplitArticleFileModule_EAR.ear] failed
    at com.sap.engine.services.deploy.server.DeployServiceImpl.catchDeploymentExceptionWithDSRem(DeployServiceImpl.java:3370)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.deploy(DeployServiceImpl.java:315)
    at com.sap.engine.services.dc.gd.impl.ApplicationDeployer.deploy(ApplicationDeployer.java:139)
    ... 11 more
    Caused by: com.sap.engine.services.deploy.container.rtgen.GenerationException: Open failed for '/usr/sap/DP2/J64/j2ee/cluster/server0/temp/deploy/SplitArticleFileModule_EAR.ear1422275742985/com.sap.aii.utilxi.server.jar' with fd 218 returning message 'couldn't find 'END' tag' and errno 0 after trying cache.
    at com.sap.engine.services.webservices.server.deploy.preprocess.WebServicesGenerator.createSingleModule(WebServicesGenerator.java:100)
    at com.sap.engine.services.webservices.server.deploy.preprocess.WebServicesGenerator.generate(WebServicesGenerator.java:54)
    at com.sap.engine.services.deploy.container.rtgen.AnnotationsSupportingGenerator.generate(AnnotationsSupportingGenerator.java:27)
    at com.sap.engine.services.deploy.ear.jar.moduledetect.GeneratorWrapper.generate(GeneratorWrapper.java:43)
    at com.sap.engine.services.deploy.ear.jar.ModuleGeneratorTool.generate(ModuleGeneratorTool.java:110)
    at com.sap.engine.services.deploy.ear.jar.ModuleGeneratorTool.generateOverExistingModules(ModuleGeneratorTool.java:97)
    at com.sap.engine.services.deploy.ear.jar.ModuleGeneratorTool.generateModules(ModuleGeneratorTool.java:80)
    at com.sap.engine.services.deploy.ear.jar.EARReader.read(EARReader.java:240)
    at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.prepareNewDeploymentInfo(DeployUtilTransaction.java:217)
    at com.sap.engine.services.deploy.server.application.DeploymentTransaction.begin(DeploymentTransaction.java:199)
    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:421)
    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:473)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:1836)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.deploy(DeployServiceImpl.java:360)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.deploy(DeployServiceImpl.java:313)
    ... 12 more
    Caused by: java.util.zip.ZipException: Open failed for '/usr/sap/DP2/J64/j2ee/cluster/server0/temp/deploy/SplitArticleFileModule_EAR.ear1422275742985/com.sap.aii.utilxi.server.jar' with fd 218 returning message 'couldn't find 'END' tag' and errno 0 after trying cache.
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:154)
    at java.util.jar.JarFile.<init>(JarFile.java:141)
    at java.util.jar.JarFile.<init>(JarFile.java:105)
    at com.sap.engine.services.webservices.server.deploy.preprocess.WebServicesSupportHandlerImpl.generateWebSupport(WebServicesSupportHandlerImpl.java:79)
    at com.sap.engine.services.webservices.server.deploy.preprocess.WebServicesGenerator.createSingleModule(WebServicesGenerator.java:69)
    ... 26 more
    Maybe the used jar files could be the problem?

  • Custom adapter module deployment in PI 7.1

    We upgrade XI 3.0 to PI 7.1. However, I dont see SDM directory anymore which is what I had used to deploy my custom adapter module.
    Is there a different way to deploy custom adapter module in 7.1? Is SDM discontinued?
    When I try to deploy the ear file from NWDS directly I get deployment exception error
    "Deployment exception : Cannot determine sdm host (is empty). Please configure your engine/sdm correctly !".
    I have given the message server host and port correctly in preferences.
    I am using NWDS 7 and JAVA SDK 1.4.2.15.
    Is there a new procedure to deploy custom adapters in PI 7.1?
    Regards
    Haseeb

    hi,
    check this document:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00838345-708c-2a10-1199-9514c0b0a91c
    regards.

  • Code to retrive the sender and receiver interface names using custome adapter module

    Hello Team,
    I want to develop an custom adapter module which could retrieve the names of the sender and receiver interfaces of the scenario and for that i am trying to use com.sap.aii.af.service.administration.api.monitoring.ProcessContextFactory.ParamSet but i don't know whether this API will support or not and also i don't know how to develop the code using this API so please suggest me some code for it so that i could retrieve the names.
    Thanks you all in advance.
    Regards,
    Avinash.   

    Hi,
    Just ASMA setting will do the needful. Are you planning to rename your target file name. If yes then only you will require UDF.
    Update: Since your directory name will be taken from source file name then you have to use mapping for this, else it will not be possible.
    I don't know if creating a new module for this will help you solve the issue, but in that case rather creating adapter module, mapping will be easier.
    Regards,
    Sarvesh
    Edited by: Sarvesh Singh on Dec 7, 2009 3:04 PM

  • Uses of custom adapter module

    hi all,
    I am doing a POC on exploring custom adapter modules. Can anyone please help me in understanding various possible uses of adapter module?
    I already know about creating PDF file, Reading/Writing Excel file, Encode/Decode, setting FileName, Sending attachment through Mail Adapter. Any other possible use of adapter module?
    Thanks,
    Mayank

    hi Jyothi,
    Now i am getting following error:
    Error jxl.read.biff.BiffException: Unable to recognize OLE stream
    My lines of code are:
                   System.out.println("01");
                   FileInputStream fis = new FileInputStream("C:
    Documents and Settings
    Mayank
    Desktop
    mayank1.xls");
                   System.out.println("001");
                   String str = fis.toString();
                   System.out.println("0001");
                   byte src [] = str.getBytes();
                   System.out.println("00001");
                   ByteArrayInputStream f5 = new ByteArrayInputStream(src);
                   System.out.println("000001");
                   Workbook workbook1 = Workbook.getWorkbook(f5);
                   System.out.println("000002");
    i am using lines because i will be converting xmlpayload to bytestream in actual module code.
    And output i am getting is:
    01
    001
    0001
    00001
    000001
    Error jxl.read.biff.BiffException: Unable to recognize OLE stream
    which means there is some problem in line
    Workbook workbook1 = Workbook.getWorkbook(f5);
    Also when i am reading file using:
    Workbook workbook = Workbook.getWorkbook(new FileInputStream("C:
    Documents and Settings
    Mayank
    Desktop
    mayank1.xls")); ,, it's working.
    Thanks,
    Mayank

  • Get Message details in custom adapter module

    Hello,
    Could you please let me know how can we retrieve following parameters in custom adapter module?
    Message size
    Message Mapping name
    Operation Mapping name
    Sender and Receiver Interface names
    Thanks!
    Regards,
    Shweta

    Hi Shweta
    Not all the information is available directly from the adapter module.
    Message size
    Retrieve the input stream of the payload, convert the stream to bytes and count the bytes length.
    Message msg = (Message) inputModuleData.getPrincipalData();
    XMLPayload payload = msg.getDocument();
    InputStream inStr = payload.getInputStream();
    // Convert inStream to bytes
    int size = bytes.length;
    Sender and Receiver interface names
    You can only get Sender interface in sender module, and receiver interface in receiver module. You can get the from the getAction() method.
    Message msg = (Message) inputModuleData.getPrincipalData();
    String interfaceName = msg.getAction().getName();
    Operation Mapping name
    This is not directly available from the Adapter Framework. One workaround is to access this via the Integration Directory API. With the Interface Determination Service API, you can read the Interface Determination object to get the associated mapping. To do this you have to make a SOAP call to the API.
    Message Mapping name
    I'm not sure how this can be retrieved as this is only available in ESR.
    If the module is on the receiver side, another option is to extract the information during mapping and store it into Dynamic Configuration, then in the receiver module, to extract it from Dynamic Configuration.
    Rgds
    Eng Swee

  • Required JAR's for developing custom adapter modules for PI 7.31 SP 09

    Hello experts,
    I have a new development wherein i have to consume .xlsx files in PI 7.31
    i have gone through a lot of blogs but did not find any relevant JAR's specially for PI 7.31, I am planning  to go for custom module development for conversion of .xlsx file into xml
    so need your help for finding the JAR's for PI 7.31 and also some custom JAVA source code for conversion of excel spreadsheet into XML.
    Regards,
    Sushant.Shinde

    Hi sushant,
    The module key seems correct ffor you. But the blog you shared is cozy. I developed 4 adapter modules using a document. Please refer that.
    And NWDS EHP1 is available you can use that to be perfectly sure on compatibility.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa?overridelayout=true
    use the above document to verify the steps you followed-
    Please provide following screenshots
    NWA->configuration->infrastructure->Application Modules-> and search for *xlmodule*
    if you find your module then click on it and at the bottom there will be a window with JNDI Name. Share that JNDI name and use that JNDI name in your Module. (localejbs/JNDIName).
    Also go to NWA->TroubleShooting-> JNDI Browser and see where is your Adapter module situated. I mean under which directory. Either directly inside root/localejbs/ or root/localejbs/sap.com.
    Please verify your steps according to that and redeploy and share result.
    and Go to NWA- Site Map-> find Start & Stop
    In that go to Java Applicaitons Tab and search for your module. It must be started. If it is stopped try starting it.
    Regards,
    Vikas

  • Custom adapter module throwing exception

    Hi,
         We have written an adapter module (EJB) to convert a file structure into XML for conversion in XI. Using file adapter(FTP), we are getting the files converted into XML without any problem. However, when there is no file in the directory the module is throwing an exception and writing an entry into the log (polling interval is 1 minute).
    The requirement is when there is no file in the directory, the adapter should keep on polling, but without generating any exception or making an entry in the log.
    Can anyone help out with this please?

    strange...
    if a file is not found in the specified directory where your file adapter is polling, it is not possible that the control comes to the adapter module you have specified in the module chain.
    have you done something unusual in your CC config i.e. added only your module in the module chain and removed CallSAPAdapter

  • Addition of a header line to a flat file using Custom Adapter Module?

    Is the header that you want to add to the input file always a constant?
    In that case why go for a module. Directly map the required constants during the mapping to your IDoc.
    My suggestion is to avoid the module

    Hi Shabrish,
    The Header is not a constant field always as the value changes per file adapter so a module will be helpful, and it will be a must to add the Header record as the first line.
    Can you suggest/direct me to some appropriate blogs? Thanks
    Regards,
    Nipun

  • How to Convert EAR to SDA & Deploy it to PI 7.1 for Custom Adapter Module

    Hi all,
    I need to convert an EAR file created using NWDS 7.1 to SDA file and deploy it to PI 7.1
    How can i do so.
    Please help if possible! Thanks!
    Mayank

    hi Mayank,
    I quote from help.sap
    "●      Use the SAP NetWeaver Developer Studio and the SDM in the following cases:
    ○       If the source files of the application are available, you can import them into the relevant project types in the SAP NetWeaver Developer Studio and then build the archive files. This scenario enables you to change the code of the application if necessary, as well as to build an application archive, which can be deployed using the SDM.
    This graphic is explained in the accompanying text
    You can convert the application using the Converter Tool to see what information you should include in the additional deployment descriptors. Then you can edit the generated descriptors in the SAP NetWeaver Developer Studio.
    ○       If your applicationu2019s EAR file contains the descriptors required to deploy it with the SDM (sda-dd.xml), you can use the SDM to deploy it on the J2EE Engine 7.0. The EAR is automatically converted at deployment time.
    This graphic is explained in the accompanying text
    When the application is converted using the SDM, the newly generated descriptors are used during deployment only and are not stored in the file system. You cannot reuse the converted application later. Therefore, we recommend that you convert the application using the Converter Tool first, and then deploy it using the SDM.
    ●      Using the Deploy Tool is more convenient in the following cases:
    ○       If only the EAR of the application is available and it does not contain the sda-dd.xml, use the Deploy Tool to convert and deploy the application on the J2EE Engine. Note that once the application EAR has been converted, it is no longer compatible with 6.20.
    http://help.sap.com/saphelp_nw04s/helpdata/EN/2c/dd813e77d46245e10000000a114084/content.htm
    Regards
    joel

  • Class Cast Exception in a custom adapter processing module

    Hi,
    I am trying to create a Custom adapter module in my file adapter as a Local enterprise Bean.
    I have taken the "ConvertCRLFfromToLF" sample given by SAP as a reference, created an EJB module project, and deployed the enterprise archive to the J2EE engine.
    However, i am getting a Class Cast Exception in the Adapter Engine for my communication channel.
    Any help on this will much appreciated.
    Thanks & Regards,
    Renjith.

    HI,
    Managed to solve this..this was due to the additional jars which was included by the Developer Studio in the EAR file. We have to remoce the jars from the EAR, change the application.xml and sap_manifest.mf files to give reference to the jars already deployed in the J2EE engine.
    Thanks & Regards,
    Renjith

  • Using a different user(other than default PI user) with adapter module

    Hi,
    We are having a custom adapter module built to interact with a Hardware Security Module(HSM). This custom adapter module by default uses a PI user configured in the system. However, we are not able to pass commands to HSM because of insufficient authorizations to this PI user. Now, we do not exactly know the permissions required for the user to access HSM. We have asked the HSM support team about the same. However, I wanted to explore the possibility of using a different PI user to work with the adapter module and eventually pass commands to HSM.
    We have an admin user configured which has all the necessary authorizations. Is it possible to use this admin user created on PI system to work with adapter module so that it passes commands to HSM?
    Thanks,
    Ravi Desai

    We have given the necessary authorizations to PI user.

  • Adapter Module Error-Sending excel file as an attachment of the mail

    Hi ,
    My scenario is as follows
    1)I am sending an excel file as an attachment of the mail.I need to read that excel attachment as a payload.
    So mail adapter is used in sender side.
      To configure this, have used standard PayloadSwapBean  module with proper module key.
      Next to convert excel to XML another custom adapter module is being used.
    Both this adapter module , I configured into the CC of sender mail adapter.
    The order in which adapter modules are being used in the sender CC are as follows
    1)localejbs/AF_Modules/PayloadSwapBean
    2)localejbs/MDPExcelToXMLConversion
    3)sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean
    MDPExcelToXMLConversion-Custom adapter module written to convert excel to xml.
    I am getting the following error
    exception caught during processing mail message [4899]com.sap.aii.af.lib.mp.module.ModuleException
    And also,
    no messages in coming MONI of PI.
    Pls suggest what to do.
    Thanks
    Ayan

    Shabarish,
    Will the ordering in which the adapter modules(In this case there are two-PayloadSwapBean & MDPExcelToXML) are appearing into Module tab of sender adapter matter?
    Firstly, what is happenning
    1)If I take out the custom  adapter module MDPExcelToXML and put only PayloadSwapBean  then it is successfully converting mail attachment into the main Payload i.e PayloadSwapBean   module is working.
    2)Nextly, my local code( i.e java code without including standard Module specific method like ejbActivate(),ejbPassivate(),process()  etc etc.)) for MDPExcelToXML is successfuly converting the excel file into the XML file.Then I am making the local code into adapter module specific code and deploying that.
    A few question arises here,
    Do I need to do any specific configurations here in PI for this particular things.Maybe both the adapter module is clashing with each other.
    And also using tracing and logging into my custom adapter module code.Getting the following error,
    java.io.IOException: Unable to read entire header; 116 bytes read; expected 512 bytes#
    Thanks
    Ayan

  • Adapter Module in SOAP Sender Adapter

    Hi All,
    To Confirm, Is it possible to use Custom Adapter Modules in SOAP Sender Adapter. If so, where exactly custom module has to be placed in communication channel with respect to the standard bean of SOAP Adapter.
    Thanks in advance.
    Regards,
    Sudharshan N A

    Hi,
    The sender adapter cannot be extended Check this
    http://help.sap.com/saphelp_nwpi711/helpdata/en/43/951aceb1146353e10000000a11466f/frameset.htm
    http://help.sap.com/saphelp_nwpi711/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/frameset.htm
    Regards
    Suraj

Maybe you are looking for