OPI2 EDIFACT adapter - Module Exception Error

Hi,
We are on pI 7.0. Deployed open source custom EDI adapter (OPI2).
Scenario: IDOC - - - xi -- - EDIFACT
When I executed the scenario, I get the following error in comm channel monitoring.
2010-10-14 14:19:52 Success Message successfully received by messaging system. Profile: XI URL: http://xidev:50000/MessagingSystem/receive/AFW/XI Credential (User): PIISUSER
2010-10-14 14:19:52 Success Using connection EDIFACT_http://cbsgmbh.com/xi/EDIFACT/Adapter. Trying to put the message into the receive queue.
2010-10-14 14:19:52 Success Message successfully put into the queue.
2010-10-14 14:19:52 Success The message was successfully retrieved from the receive queue.
2010-10-14 14:19:52 Success The message status set to DLNG.
2010-10-14 14:19:52 Success Delivering to channel: CC_EDIFACT_Orders_recv
2010-10-14 14:19:52 Success MP: Entering module processor
2010-10-14 14:19:52 Success MP: Processing local module localejbs/opi2/edifact/CryptModule
2010-10-14 14:19:52 Error MP: Exception caught with cause com.sap.aii.af.mp.module.ModuleException caused by: java.lang.NullPointerException
2010-10-14 14:19:52 Error Exception caught by adapter framework: null
Please help,
mk

Hi,
I have removed "CRYPT" module from communication channel modules list since I am not using any encryption at this time. However, I get different error as below.
MP: Exception caught with cause com.sap.aii.af.mp.module.ModuleException: Configuration lookup failed caused by: com.sap.aii.af.mp.module.ModuleException: Address normalization (alternativeID) is not defined for : agency = UNB  ZZZ  117, schema = UNBID, partyId = EDI_ATMEL
Note: I have maintained AS2 ZZZ 117, AS2ID in both sender party & receiver party identifiers. Also, I have referred sender party and sender business system in receiver agreement header mapping.
Please help,
MK

Similar Messages

  • Adapter Module deployment error in PI 7.1

    Hi Experts,
    I have successfully deployed a adapter module on PI 7.1 thru NWDS, I see the ejb in NWA as well...
    when i try to use it tit throws this error in comm channel monitoring
    Error: javax.ejb.TransactionRolledbackLocalException: (Failed in component: sap.com/UserModule_EAR) Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.sap.adaptermodule.GetHostNameBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.sap.adaptermodule.GetHostNameBean@299c92f0 for bean sap.com/UserModule_EARxml|UserModule_EJB.jarxml|GetHostName in application sap.com/UserModule_EAR.; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBException: (Failed in component: sap.com/UserModule_EAR) Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.sap.adaptermodule.GetHostNameBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.sap.adaptermodule.GetHostNameBean@299c92f0 for bean sap.com/UserModule_EARxml|UserModule_EJB.jarxml|GetHostName in application sap.com/UserModule_EAR.; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBTransactionRolledbackException: (Failed in component: sap.com/UserModule_EAR) Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.sap.adaptermodule.GetHostNameBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.sap.adaptermodule.GetHostNameBean@299c92f0 for bean sap.com/UserModule_EARxml|UserModule_EJB.jarxml|GetHostName in application sap.com/UserModule_EAR.; nested exception is: java.lang.NullPointerException; nested exception is: javax.ejb.EJBException: (Failed in component: sap.com/UserModule_EAR) Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.sap.adaptermodule.GetHostNameBean.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.sap.adaptermodule.GetHostNameBean@299c92f0 for bean sap.com/UserModule_EARxml|UserModule_EJB.jarxml|GetHostName in application sap.com/UserModule_EAR.; nested exception is: java.lang.NullPointerException
    any help is appreciated
    Regards,
    Teja

    Hi Prateek,
    Im facing the same issue...,So i thought I should add to this thread instead of posting a new one
    The com channel looks as follows
    Processing sequence:
    Number      ModuleName                   Type                                  moduleKey
    1                ModuleName                     LocalEnterpriseBean          0
    2               CallSapAdapter                 LocalEnterpriseBean          2
    Module Configuration
    I have nt added anything in this module configuration tab...can u help me on this
    Edited by: Ibrahim on Sep 9, 2009 12:50 PM

  • Adapter modules: messageTransformBean : error in recordset validation

    Hi all,
    I am using adapter modules in PI. I have written my own module that checks for a valid key field name on each line of an incoming file, then the messageTransformBean module is called. I took this approach because 'standard' file content conversion ignores lines that don't begin with a valid key field name, and I need to be able to error in this situation.
    My module is working just fine, but the messageTransformBean one is not. I'm using the 'structPlain2XML' conversion type, and have two line types (apart from the header and trailer) so the xml.recordsetStructure parameter is Header , 1 , Detail, * , MeterRegisterDetail , * , Trailer, 1 along with the appropriate key field definitions etc. The recordsetSequence is set to variable.
    The problem is that files like this:
    Header
    Detail
    MeterRegisterDetail
    Detail
    MeterRegisterDetail
    Trailer
    fail for some reason ! It seems to be the repeating Detail that is the problem. The error message in the audit log is:
    'Error converting Message: 'java.lang.Exception: ERROR consistency check in recordset structure validation (line no. 4: missing structure(s) before type 'Detail''
    A similar setup with say Header,1,Detail, *, Trailer,1 as the resordsetStructure is fine with repeating Details, and if I put in a Trailer record before the second Detail it goes in fine as well !
    Any ideas ? I'm pulling my hair out with this one !
    Cheers,
    Nick

    Thanks for the reply, but that's only the case if you don't set a variable record set sequence. I've found the problem though - looking through some old XI documentation it seems the naming convention is not quite the same as standard content conversion, the parameter should be xml.recordsetStructure = var, not recordsetSequence = variable !!!
    Anyway, fixed now, so I'm happy. Thanks again.

  • File adapter module enhancement error

    Hello All,
    We have a EDI scenario where data for 110 is to be transfered to SAP. Here customer is not able to ahead with seeburger hence decided to develope a adapter module. We have done that  and started testing . While testing we are getting a error, in which ":" is field separator which is getting converted to  "[]" . This we found when we debugged module process method. Pl can you suggest why this conversion is happening and how to resolve.
    If you see , When I use only standared sap module file is getting read as it is. There is no such conversion happening.
    Pl can you suggest at the earliest possible.
    thanks,
    Sharada

    Hi,
    I think you have done a typo error. is it not
    localejbs/SeeClassifier classifier*
    To find the correct JNDI lookup name, log in to Visual Administrator of the J2EE Engine and in server node look for the JNDI Registry Service.Spot your desired bean and fetch the whole JNDI name form there.
    Regards,
    Sudharshan N A

  • Error in adapter module - jndi lookup can't find the class

    Hi gurus,
    I have a problem with my adapter module, the error from the RWB is:
    Error: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of KFCProc.
    My EJB-JAR looks like this:
      <?xml version="1.0" encoding="UTF-8" ?>
      <!DOCTYPE ejb-jar (View Source for full doctype...)>
    <ejb-jar>
      <description>EJB JAR description</description>
      <display-name>EJB JAR</display-name>
    <enterprise-beans>
    <session>
      <ejb-name>KFCProc</ejb-name>
      <home>com.sap.aii.af.mp.module.ModuleHome</home>
      <remote>com.sap.aii.af.mp.module.ModuleRemote</remote>
      <local-home>com.sap.aii.af.mp.module.ModuleLocalHome</local-home>
      <local>com.sap.aii.af.mp.module.ModuleLocal</local>
      <ejb-class>com.sap.adapter.KFCProc</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      </session>
      </enterprise-beans>
      </ejb-jar>
    I think it should be all right, but it isn't.
    Can be the problem, that I use for "com.sap.adapter.KFCProc"package "com.sap..."?
    Thank you,
    Olian

    Hi Stefan,
    I developed it using your document
    This is my ejb-j2ee-engine.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-j2ee-engine SYSTEM "ejb-j2ee-engine.dtd">
    <ejb-j2ee-engine>
         <enterprise-beans>
              <enterprise-bean>
                   <ejb-name>KFCProc</ejb-name>
                   <jndi-name>KFCProc</jndi-name>
                   <session-props/>
              </enterprise-bean>
         </enterprise-beans>
    </ejb-j2ee-engine>
    My entry in Modules tab of CC config is
    localejbs/KFCProc
    I think this all should be ok...
    Thanks,
    Olian

  • Adapter Module Error Log

    Hi all,
    I am doing an IDOC to File Scenario. In the File adapter i am using the Module tab to configure the file adpater to call conversion agent service(CMTransform Bean). When there is any error while processing the bean in adapter module the error is logged in the Java stack but in SXMB_MONI it shows checkered flag. Will it be possible to log the same error in SXMB_MONI so that we can know if there was any problems while processing?
    Thank you.
    Suman

    No this will not be possible.
    SXMB_MONI allows you to monitor messages in the Integration Engine and the Business Process Engine.
    In this case the error has occured in the Adapter Engine after the message has been successfully transmitted by the Integration Engine to the Adapter Engine and so there is success in MONI.
    Solution : Use XI Alerts, get automatic intimations of error in both IE and AE.
    Regards
    Bhavesh

  • Adapter Module for File Adapter

    I have a scenario where I have 2 related files (text file and a pdf file) for the message. I need to enhance the payload (content conversion from text file) with the size of the pdf file. I have developed a adapter module for this and it is working fine if there is 1 set of text and pdf file. But if there are more than 1 set of files, it is processing the first set and giving the below error for other files.
    "Error: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback."
    Regards
    Yogesh

    check this thread :
    BaseTransactionRolledbackLocalException in custom adapter module
    Exceptions in Recievr Communication Channel with Adapter Module

  • Adapter Module Error in PI 7.1

    Hi,
    I have built an adapter module which has been successfully deployed on PI 7.1 using JSPM, but in communication channel monitoring it is giving below error.
    Error: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of UserModuleTestEjb
    In Module tab of communication channel I have passed Bean name, which works fine for other Adapter Module but strangely its not working for this one.
    I have also passed JNDI name which is same as EJB bean name. I have tried several other combinations like below none is working.
    localeejbs/UserModuleTestEjb
    localeejbs/sap.com/UserModuleTestEjb
    Regards,
    Nishant

    hi,
    Check if u have added correct references in application-j2ee-engine.xml file and if u are using external library it is there in SDA file.
    /people/stefan.grube/blog/2008/12/11/adjust-your-pi-70-adapter-modules-for-pi-71-in-15-minutes
    Thanks.

  • 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

  • File to File scenario Error: Module Exception

    Hi guys,
    I'm setting up a very simple file to file scenario in XI 3.0
    After doing all the set ups in Desing and configuration. In the Adapter Monitor, I'm getting the following error for the SENDER File Adapter:
    Sender Adapter v1014 for Party '', Service 'BS_File_transfer':
    Configured at 16:00:16 2008-02-20
    Last message processing started 16:06:01 2008-02-20, Error: Module exception java.lang.ClassCastException found  last retry interval started 16:06:01 2008-02-20
      length 5,000 secs
    Does anyone migth no what could be the problem? There are very simple mappings, 1 to 1, no conversion of any kind.
    Thanks
    Felipe

    Raj,
    Please note that the Scenario that I'm setting up it is simple FILE to FILE scenario.
    The error showed in the Adapter Monitor is this one:
    Sender Adapter v1014 for Party '', Service 'BS_File_transfer':
    Configured at 19:15:28 2008-02-20
    Last message processing started 19:24:23 2008-02-20, Error: Module exception java.lang.ClassCastException found
      last retry interval started 19:24:23 2008-02-20
      length 5,000 secs
    The JDBC Driver error (what I told you, relates to the driver, connection, etc)
    Sender Adapter v0915 for Party '', Service 'BS_File_sinMM':
    Configured at 19:03:51 2008-02-20
    Processing Error:  Loading jdbc driver 'oracle.jdbc.driver.OracleDriver' failed: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    Found in negative cache
    Loader Info -
    ClassLoader name: [service:com.sap.aii.adapter.jdbc.svc]
    Parent loader name: [Frame ClassLoader]
    References:
       service:com.sap.aii.af.cpa.svc
       service:com.sap.aii.af.ms.svc
       service:com.sap.aii.af.svc
       service:com.sap.aii.adapter.xi.svc
       library:com.sap.aii.af.lib
       library:com.sap.aii.messaging.runtime
       library:com.sap.xi.util.misc
       common:service:iiop;service:naming;service:p4;service:ts
       common:library:com.sap.security.api.sda;library:com.sap.security.core.sda;library:security.class;library:webservices_lib;service:com.sap.security.core.ume.service;service:connector;service:dbpool;service:keystore;service:security;service:userstore
       library:ejb20
       library:sapxmltoolkit
       library:com.sap.guid
       library:com.sap.tc.Logging
       library:jms
    Resources:
       C:\usr\sap\DEX\DVEBMGS04\j2ee\cluster\server0\bin\services\com.sap.aii.adapter.jdbc.svc\aii_adapter_jdbc_svc.jar
    Loading model: {parent,local,references}
    Available JDBC drivers:
    No deployed JDBC Drivers found
    Still here...
    Felipe
    Edited by: Felipe Andres Contreras on Feb 20, 2008 11:24 PM

  • Error in adapter module Upgrade PI7.11

    Hello,
    After upgrade from XI3.0 to PI7.11,I am trying to adapt code of an adapter module in order to use it in new version.
    I have changed the code ,there were no compilation errors and it was deployed successfully.
    But when trying to test the scenario ,I am getting following error:
    <code>ADAPTER.JAVA_EXCEPTION</code>
                   <text>javax.ejb.EJBException: (Failed in component: sap.com/ValidationModule7.11_EAR) Exception raised from invocation of public com.sap.aii.af.lib.mp.module.ModuleData com.sapcons.xi.af.validation.ValidationModuleBean711.process(com.sap.aii.af.lib.mp.module.ModuleContext,com.sap.aii.af.lib.mp.module.ModuleData) throws com.sap.aii.af.lib.mp.module.ModuleException method on bean instance com.sapcons.xi.af.validation.ValidationModuleBean711@4dee79d1 for bean sap.com/ValidationModule7.11_EARxml|ValidationModule7.11_EJB.jarxml|ValidationModuleBean711 in application sap.com/ValidationModule7.11_EAR.; nested exception is: java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.MessageKey.getMessageId() of an object loaded from local variable 'msgKey'
    java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.MessageKey.getMessageId() of an object loaded from local variable 'msgKey'
    I am nowhere using variable 'msgkey' in my code.
    I was using getMessageId() method and because of this error,I have changed the code such that I am not using this method at all.
    After this change ,I have deployed the module again,and the strange part is I am still getting the same error.
    Just to be sure that I have deployed the changed code,I created an altogether new module ValidationModule7.11_EAR(it was ValidationModule_EAR before) and deployed it,I am sure ,I am not using getMessageId() method at all,but I am getting the same error (as mentioned above).
    I have no idea why I am getting the same error.I can see in the error message that my new module is called which doesn't use this method.
    Can anyone please suggest apart from saving the Bean after code changes and redeploying the code,what needs to be done.
    (Rebuilding the project,etc.)
    It would be great if I can get some inputs on this strange behaviour.
    Thanks a lot.
    Best Regards,
    Shweta

    Hello Stefan,
    Thanks for your reply.
    I have created my new module with a different JNDI name.
    Also,I have verified that there is a link to the interface com.sap.aii.af.ifc.facade in application-j2ee-engine.xml .
    This was the code which I was trying to adapt:
    if((MessageContext)inputModuleData.getPrincipalData() instanceof MessageContext)
                    MessageContext messsageContext = (MessageContext)inputModuleData.getPrincipalData();
                    Message message = messsageContext.getMessage();
                    Attachment rootDocument = message.getRootDocument();
                    Object data = rootDocument.getData();
                    if(data instanceof Binary)
                        Binary bin = (Binary)data;
                        request = bin.getBytes();
                        String messageID = "1232";
                        if(dir == Direction.INBOUND)
                            amk = new AuditMessageKey(messageID, AuditDirection.INBOUND);
                        else
                            amk = new AuditMessageKey(messageID, AuditDirection.OUTBOUND);
    But I was getting errors like MessageContext not recognized and also,for the statement:
    Attachment rootDocument = message.getRootDocument();
    I was getting an error in statement :   if(data instanceof Binary) as following imports weren't recognized.
    import com.sap.aii.messaging.lang.Binary;
    import com.sap.aii.messaging.mo.*;
    So I used import com.sap.aii.af.service.cpa.BinaryData; and following code
    Object obj = null;
                   Message message = null;
                   obj = inputModuleData.getPrincipalData();
                              if(obj instanceof BinaryData)
                         message = (Message)obj;  
                        BinaryData bin = (BinaryData)obj;
                        request = bin.getData();
                         String messageID = "1232";
                          amk = new MessageKey(messageID, message.getMessageDirection());                                      
    Code was compiled correctly and deployed ,but I get this error with getMessageId() when I try to test it.You can see I am not using getMessageId() and msgkey anywhere in the code
    Thanks for your help
    Regards,
    Shweta

  • Error in Adapter Module to unzip files

    Hello ,
    I wish to unzip many files with use of an adapter module
    To du this I use following code
    package de.lsv.moduledevelopement;
    import java.io.*;
    import java.util.Hashtable;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipInputStream;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import javax.ejb.CreateException;
    import com.sap.aii.af.mp.module.Module;
    import com.sap.aii.af.mp.module.ModuleContext;
    import com.sap.aii.af.mp.module.ModuleData;
    import com.sap.aii.af.mp.module.ModuleException;
    import com.sap.aii.af.ra.ms.api.Message;
    import com.sap.aii.af.ra.ms.api.MessageDirection;
    import com.sap.aii.af.ra.ms.api.Payload;
    import com.sap.aii.af.ra.ms.spi.Trace;
    import com.sap.aii.af.service.auditlog.Audit;
    import com.sap.aii.af.service.auditlog.AuditDirection;
    import com.sap.aii.af.service.auditlog.AuditLogStatus;
    import com.sap.aii.af.service.auditlog.AuditMessageKey;
    * @ejbLocal <{de.lsv.moduledevelopement.UnZipFilesLocal}>
    * @ejbLocalHome <{de.lsv.moduledevelopement.UnZipFilesLocalHome}>
    * @stateless
    public class UnZipFilesBean implements SessionBean, Module {
         static AuditMessageKey amk = null;
         static String auditStr = "UnzipFilesBean - ";
         static ModuleException mEx = null;
         public static final String VERSION_ID =
              "$Id://de.lsv.moduledevelopement.UnZipFilesBean.java#1 $";
         private static final Trace TRACE = new Trace(VERSION_ID);
         public void ejbRemove() {
         public void ejbActivate() {
         public void ejbPassivate() {
         public void setSessionContext(SessionContext context) {
              myContext = context;
         private SessionContext myContext;
          * Create Method.
         public void ejbCreate() throws CreateException {
              // TODO : Implement
         /* (non-Javadoc)
          * @see com.sap.aii.af.mp.module.Module#process(com.sap.aii.af.mp.module.ModuleContext, com.sap.aii.af.mp.module.ModuleData)
         public ModuleData process(
              ModuleContext moduleContext,
              ModuleData inputModuleData)
              throws ModuleException {
              Object obj = null;
              Message msg = null;
              Payload attachment = null;
              //initializing variables for module parameters
              String modkey = "";
              String fileMask = "";
              String directory = "";
              String saveDirectory = "";
              //     String newMimeType = "";
              //     String newAttachmentName = "";
              //     String newAttachmentExtension = "";
              //     String newAttachmentNameReplace = "";
              //this block is to manage the adapter when is not file/FTP
              try {
                   //get the XI Message
                   obj = inputModuleData.getPrincipalData();
                   msg = (Message) obj;
                   // create AuditMessageKey object to write audit log.
                   if (msg.getMessageDirection() == MessageDirection.INBOUND)
                        amk =
                             new AuditMessageKey(
                                  msg.getMessageId(),
                                  AuditDirection.INBOUND);
                   else
                        amk =
                             new AuditMessageKey(
                                  msg.getMessageId(),
                                  AuditDirection.OUTBOUND);
                   // ******start get the module parameters from the configuration******
                   modkey = moduleContext.getContextData("module.key");
                   Audit.addAuditLogEntry(
                        amk,
                        AuditLogStatus.SUCCESS,
                        auditStr + "Module Configuration Key: " + modkey);
                   //***** einlesen der Moduke Parameter******************
                   //***** DateiMaske
                   fileMask = moduleContext.getContextData("FileMask");
                   Audit.addAuditLogEntry(
                        amk,
                        AuditLogStatus.SUCCESS,
                        auditStr + "FileMask: " + fileMask);
                   // check ob fileMask definiert ist
                   if (fileMask == null || fileMask.equalsIgnoreCase("")) {
                        //if no attachment name is specified in the module configuration the module will end the execution
                        throw mEx =
                             new ModuleException(
                                  auditStr
                                       + "!FileMask in Modulconfiguration nicht definiert!");
                   //***** DateiMaske2
                   String fileMask2 = moduleContext.getContextData("FileMask2");
                   Audit.addAuditLogEntry(
                        amk,
                        AuditLogStatus.SUCCESS,
                        auditStr + "FileMask2: " + fileMask2);
                   //***** Directory
                   directory = moduleContext.getContextData("Directory");
                   Audit.addAuditLogEntry(
                        amk,
                        AuditLogStatus.SUCCESS,
                        auditStr + "Directory: " + directory);
                   // Fehler wenn Directory nicht definiert
                   if (directory == null || directory.equalsIgnoreCase("")) {
                        //the module will end the execution
                        throw mEx =
                             new ModuleException(
                                  auditStr
                                       + "Directory in Modulconfiguration nicht definiert");
                   //***** Sicherungs Verzeichnis
                   saveDirectory = moduleContext.getContextData("SaveDirectory");
                   Audit.addAuditLogEntry(
                        amk,
                        AuditLogStatus.SUCCESS,
                        auditStr + "SaveDirectory: " + saveDirectory);
                   // entpacken aufrufen
                   entpacke(directory, saveDirectory, fileMask);
                   if (fileMask2.length() > 0) {
                        entpacke(directory, saveDirectory, fileMask2);
                   //update the XI Message
                   inputModuleData.setPrincipalData(msg);
              } catch (Exception e) {
                   String errorMessage =
                        auditStr + "Error bei der . Exception:" + e.getMessage();
                   Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR, errorMessage);
                   throw mEx = new ModuleException(auditStr + errorMessage);
              Audit.addAuditLogEntry(
                   amk,
                   AuditLogStatus.SUCCESS,
                   auditStr + "Verarbeitung beendet ");
              return inputModuleData;
         //+++++++++++++++++++++++++
         private static void entpacke(
              String directory,
              String saveDirectory,
              String mask)
              // TODO Auto-generated method stub
              Audit.addAuditLogEntry(
                   amk,
                   AuditLogStatus.SUCCESS,
                   auditStr + "Funktion entpacke");
              if (!directory.endsWith("\")) {
                   directory = directory + "\";
              } // if
              File f;
              f = new File(directory);
              Audit.addAuditLogEntry(
                   amk,
                   AuditLogStatus.SUCCESS,
                   auditStr + "f = new File(directory)");
    //          // Achtung Klasse in einer Klasse :-)
    //          String[] strFiles = f.list(new FilenameFilter() {
    //               public boolean accept(File file, String filename) {
    //                    Wildcard wildcard1 = new Wildcard(mask);
    //                    Audit.addAuditLogEntry(
    //                         amk,
    //                         AuditLogStatus.SUCCESS,
    //                         auditStr + "wc1");
    //                    return wildcard1.match(filename, false);
              String [] strFiles = f.list(new MyFilter(mask));
              // Liste der Gefundenen dateien
              Audit.addAuditLogEntry(
                   amk,
                   AuditLogStatus.SUCCESS,
                   auditStr + "Anzahl gepackter Dateien: " + strFiles.length);
              //System.out.println( strFiles.length + " Dateien zum entpacken");
              for (int i = 0; i < strFiles.length; i++) {
                   Audit.addAuditLogEntry(
                        amk,
                        AuditLogStatus.SUCCESS,
                        auditStr + "verarbeite Datei: : " + strFiles<i>);
                   //     System.out.println("f[" + i + "]=" + strFiles<i>);
              } // for
              // *****entpacken**********************
              for (int i = 0; i < strFiles.length; i++) {
                   try {
                        byte[] buf = new byte[4096];
                        ZipInputStream in =
                             new ZipInputStream(
                                  new FileInputStream(directory + strFiles<i>));
                        Audit.addAuditLogEntry(
                             amk,
                             AuditLogStatus.SUCCESS,
                             auditStr + "Entpacke " + directory + strFiles<i>);
                        //System.out.println("Entpacke " + directory + strFiles<i>);
                        int count = 0;
                        while (true) {
                             count++;
                             // Nächsten Eintrag lesen
                             ZipEntry entry = in.getNextEntry();
                             if (entry == null) {
                                  break;
                             // Beschreibung ausgeben
                             Audit.addAuditLogEntry(
                                  amk,
                                  AuditLogStatus.SUCCESS,
                                  auditStr + entry.getName());
                             //System.out.println(entry.getName());
                             // Ausgabedatei erzeugen
                             FileOutputStream out =
                                  new FileOutputStream(directory + entry.getName());
                             int len;
                             while ((len = in.read(buf)) > 0) {
                                  out.write(buf, 0, len);
                             out.close();
                             // Eintrag schließen
                             in.closeEntry();
                        } // while
                        in.close();
                        Audit.addAuditLogEntry(
                             amk,
                             AuditLogStatus.SUCCESS,
                             auditStr + count + "Dateien entpackt");
                        //System.out.println(count + "Dateien entpackt");
                        // verschieben
                        if (saveDirectory.length() > 0) {
                             File quelle = new File(directory + strFiles<i>);
                             File ziel = new File(saveDirectory + strFiles<i>);
                             boolean bla = quelle.renameTo(ziel);
                             if (!bla) {
                                  Audit.addAuditLogEntry(
                                       amk,
                                       AuditLogStatus.SUCCESS,
                                       auditStr
                                            + strFiles<i>
                                            + " konnte nicht verschoben werden");
                             } else {
                                  Audit.addAuditLogEntry(
                                       amk,
                                       AuditLogStatus.SUCCESS,
                                       auditStr
                                            + strFiles<i>
                                            + "verschoben nach "
                                            + saveDirectory);
                                  //          System.out.println(
                                  //               strFiles<i> + "verscgoben nach " + directory + "sik//");
                        } // if
                   } catch (Exception e) {
                        String errorMessage =
                             auditStr
                                  + "Error in entpacken. Exception:"
                                  + e.getMessage();
                        Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR, errorMessage);
                   } // catch
                   // *****entpacken*************
              } // for
         } //entpacke
    } // UnzipFilesBean
    class Wildcard {
         static AuditMessageKey amk = null;
         static String auditStr = "WildCard - ";
         static ModuleException mEx = null;
         private final String wildcardString;
          * Der Konstruktor für die WildcardSuche.
          * @param wildcardString
          *            Der WildcardString
         public Wildcard(String wildcardString) {
              this.wildcardString = wildcardString;
              Audit.addAuditLogEntry(
                   amk,
                   AuditLogStatus.SUCCESS,
                   auditStr + "Constructor");
          * Die Methode, welche den Vergleich durchführt.
          * @param str
          *            Der String, welcher darauf überprüft werden soll, ob er dem
          *            WildcardString entspricht.
          * @return true Wenn der String dem wildcardString entspricht.
         public boolean match(String str, boolean fCasesensitive) {
              if (str == null || wildcardString == null) {
                   return false;
              return recursiveMatch(wildcardString, str, fCasesensitive);
          * Hier wird der eigentliche Vergleich durchgeführt
          * @param strWildcard
          *            Der Wildcardstring, z.B.: "Test*"
          * @param str
          *            Der zu überprüfende String, z.B. "Testlauf"
          * @return true, wenn eine Übereinstimmung vorhanden ist, sonst false
         private boolean recursiveMatch(
              String strWildcard,
              String str,
              boolean fCasesensitive) {
              while (true) {
                   if (strWildcard.length() == 0)
                        return str.length() == 0;
                   char ch = strWildcard.charAt(0);
                   switch (ch) {
                        case '?' :
                             if (str.length() == 0)
                                  return false;
                             break;
                        case '*' :
                             strWildcard = strWildcard.substring(1);
                             while (true) {
                                  if (recursiveMatch(strWildcard, str, fCasesensitive))
                                       return true;
                                  if (str.length() == 0)
                                       return false;
                                  str = str.substring(1);
                        default :
                             if (str.length() == 0)
                                  return false;
                             if (fCasesensitive) {
                                  if (ch != str.charAt(0))
                                       return false;
                             } else if (
                                  Character.toLowerCase(ch)
                                       != Character.toLowerCase(str.charAt(0)))
                                  return false;
                             break;
                   strWildcard = strWildcard.substring(1);
                   str = str.substring(1);
         //++++++++++++++++++++++++++
    } // class
    /** Nun der eigentliche Filter */
    class MyFilter implements FilenameFilter {
         static AuditMessageKey amk = null;
         static String auditStr = "MyFilter - ";
         static ModuleException mEx = null;
         String fileMask;
         public MyFilter(String fileMask) {
              this.fileMask = fileMask;
              Audit.addAuditLogEntry(
                   amk,
                   AuditLogStatus.SUCCESS,
                   auditStr + "Constructor");
         } //constructor
          public boolean accept(File file, String filename) {
              // TODO Auto-generated method stub
              //fileMask = "?5LBL*";
              Wildcard wildcard1 = new Wildcard(fileMask);
              return wildcard1.match(filename, false);
    } //class
    But in Audit Protocol it failed after:
    17.09.2008 17:33:19     Erfolgreich     UnzipFilesBean - Module Configuration Key: 2
    17.09.2008 17:33:19     Erfolgreich     UnzipFilesBean - FileMask: ?5LBL???
    17.09.2008 17:33:19     Erfolgreich     UnzipFilesBean - FileMask2:
    17.09.2008 17:33:19     Erfolgreich     UnzipFilesBean - Directory: //transfer//X1E//100//99//lb//ein
    17.09.2008 17:33:19     Erfolgreich     UnzipFilesBean - SaveDirectory: //transfer//X1E//100//99//lb//ein_s
    17.09.2008 17:33:19     Erfolgreich     UnzipFilesBean - Funktion entpacke
    17.09.2008 17:33:19     Erfolgreich     UnzipFilesBean - f = new File(directory)
    17.09.2008 17:33:19     Fehler     UnzipFilesBean - Error bei der . Exception:null
    I could not find the error??
    Were there any log files to look into?
    regarts
    Zimmerningkat

    Hi Ralf,
    I am late..........
    I am bit confused with your explanation.
    1. Does all zip files will be picked by file adapter in one shot or is it conditional, since you have a XML descriptor file in firts zip file and the XML files describes the list of JPEG files which might be stored in the other zipped JPEG files?
    2. Can you tell the exact flow of your scenario
    3. Receiver in your scenario?
    Thanks,
    Gujjeti.

  • File Adapter and "permanent" module exceptions

    Hi folks,
    We have written a custom module for the file adapter which works fine .. In case of issues it will throw the standard "ModuleException".
    The file adapter is configured to move erroneous files to a specific directory .. The SAP help specifically mentions that this happens when a "permanent" exception occured ...  I quote the guide: "A permanent error occurs either during the conversion of the file content, or in a module in the module processor"
    So in case of an exception in the module processor this should work ... unfortunately it doesn't ...
    Our module throws an exception but the file is not moved and the adapter keeps on retrying to process the faulty file ...
    Anyone faced the same problem ?  Anyone any suggestion on how it should work ?
    Thanks,
    Steven

    Hi,
    When an error occurs, a module must raise a module exception.
    ModuleException can contain an exception that describes the cause of the error. To provide hints about resolving the error, the error cause is written to the trace.
    To process the message again, you do not need to set a special exception.
    In the case of receiver adapters, the messaging service for the adapter framework processes the message again. The conditions for this are set in the communication channel monitor.
    In the case of sender adapters, you must decide in the adapter implementation whether processing the message again makes sense.
    You can revert back for further queries.
    Reward if satisfied.
    Regards,
    Sushama

  • Reg :: Exception in custom java adapter module in sap pi

    Hi Experts,
                  I have included custom  java adapter module in SAP PI. I get the below error in sender communication channel  monitoring.
    Error: javax.ejb.TransactionRolledbackLocalException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/xml/utils/URI$MalformedURIException; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/xml/utils/URI$MalformedURIException; nested exception is: javax.ejb.EJBTransactionRolledbackException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/xml/utils/URI$MalformedURIException; nested exception is: javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/xml/utils/URI$MalformedURIException
    I have included in External jar files in EJB project  also..Will that cause the above exception?
    Kindly suggest your solution.
    Thanks
    Priya

    Hi !
    have a look
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e
    and this thread also
    Throw Error in Module Adapter EJB
    Thanks!

  • Deployment error in adapter module

    HI ,
    The deployment of the adapter module was successful but with exception.below is the log.
    Any help with this is appreciated
    --- Deploying file(s):
    C:\Users\am90001042\workspace\File_EAR\File_EAR.ear
    --- Status:
    Deploy finished with warnings.
    --- Description:
        S U M M A R Y
    ~~~~~~~~~~~~~~~~~~~
    Successfully deployed:       0
    Deployed with warnings:       1
    Failed deployments:        0
    ~~~~~~~~~~~~~~~~~~~
    Description:
      1. Warning occurred on server 59866950 during update sap.com/File_EAR : References Test: There are no matching deploy time references (described in META-INF/SAP_MANIFEST.MF) for the following runtime references [sap.com/engine.security.facade, sap.com/engine.j2ee14.facade, sap.com/com.sap.aii.af.svc.facade, sap.com/com.sap.aii.af.ifc.facade, com.sap/com.sap.aii.af.lib.facade, sap.com/com.sap.base.technology.facade] (described in the META-INF/application-j2ee-engine.xml)., file: File_EAR.ear, column 0, line 0, severity: warning
      2. Exception has been returned while the [sap.com/File_EAR] was starting. Warning/Exception :[
    ][[ERROR CODE DPL.DS.6193] Error while ; nested exception is:
    com.sap.engine.services.deploy.exceptions.ServerDeploymentException: [ERROR CODE DPL.DS.5030] Clusterwide exception: [server ID 59866950:[ERROR CODE DPL.DS.5029] Exception in operation [startApp] with application [sap.com/File_EAR].
       -> [ERROR CODE DPL.DS.5035] Application [sap.com/File_EAR] cannot be started. Reason: it has hard reference to resource [com.sap~com.sap.aii.af.lib.facade] with type [library], which is not active on the server.
    Hint: 1) Is referred resource deployed? 2) Is referred resource able to start?
    server ID 59866950:com.sap.engine.services.deploy.exceptions.ServerDeploymentException: [ERROR CODE DPL.DS.5035] Application [sap.com/File_EAR] cannot be started. Reason: it has hard reference to resource [com.sap~com.sap.aii.af.lib.facade] with type [library], which is not active on the server.
    Hint: 1) Is referred resource deployed? 2) Is referred resource able to start?
    at com.sap.engine.services.deploy.server.ReferenceResolver.processReferenceToLibrary(ReferenceResolver.java:752)
    at com.sap.engine.services.deploy.server.ReferenceResolver.processMakeReference(ReferenceResolver.java:568)
    at com.sap.engine.services.deploy.server.ReferenceResolver.beforeStartingApplication(ReferenceResolver.java:488)
    at com.sap.engine.services.deploy.server.application.StartTransaction.beginCommon(StartTransaction.java:192)
    at com.sap.engine.services.deploy.server.application.StartTransaction.begin(StartTransaction.java:157)
    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:493)
    at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:544)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.super_MakeAllPhases(ParallelAdapter.java:302)
    at com.sap.engine.services.deploy.server.application.StartTransaction.makeAllPhasesImpl(StartTransaction.java:579)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:213)
    at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesAndWait(ParallelAdapter.java:374)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:3455)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:3441)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:3331)
    at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationAndWait(DeployServiceImpl.java:3303)
    at com.sap.engine.services.dc.lcm.impl.J2EELCMProcessor.doStart(J2EELCMProcessor.java:105)
    at com.sap.engine.services.dc.lcm.impl.LifeCycleManagerImpl.start(LifeCycleManagerImpl.java:78)
    at com.sap.engine.services.dc.cm.deploy.impl.LifeCycleManagerStartVisitor.visit(LifeCycleManagerStartVisitor.java:34)
    at com.sap.engine.services.dc.cm.deploy.impl.DeploymentItemImpl.accept(DeploymentItemImpl.java:83)
    at com.sap.engine.services.dc.cm.deploy.impl.DefaultDeployPostProcessor.postProcessLCMDeplItem(DefaultDeployPostProcessor.java:91)
    at com.sap.engine.services.dc.cm.deploy.impl.DefaultDeployPostProcessor.postProcess(DefaultDeployPostProcessor.java:61)
    at com.sap.engine.services.dc.cm.deploy.impl.DeployerImpl.doPostProcessing(DeployerImpl.java:866)
    at com.sap.engine.services.dc.cm.deploy.impl.DeployerImpl.performDeploy(DeployerImpl.java:814)
    at com.sap.engine.services.dc.cm.deploy.impl.DeployerImpl.doDeploy(DeployerImpl.java:644)
    at com.sap.engine.services.dc.cm.deploy.impl.DeployerImpl.deploy(DeployerImpl.java:363)
    at com.sap.engine.services.dc.cm.deploy.impl.DeployerImpl.deploy(DeployerImpl.java:252)
    at com.sap.engine.services.dc.cm.deploy.impl.DeployerImplp4_Skel.dispatch(DeployerImplp4_Skel.java:897)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:362)
    at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:69)
    at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:67)
    at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:41)
    at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:977)
    at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:57)
    at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:55)
    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:327)
    Result
    Status:Warning
    Thanks
    Nikhil

    Hello,
    Cross check the references which u have added under application-j2ee-engine.xml and ejb-jar.xml.
    There used to be wiki on SDN, which provides troubleshooting steps for each error code, but i couldn't able to find that...u can also try searching the same.
    Old Link:
    https://wiki.sdn.sap.com/wiki/display/JSTSG/(JSTSG)(TG)Q1127
    Thanks
    Amit Srivastava

Maybe you are looking for

  • How do I install windows 7 drivers correctly on my macbook pro retina?

    I've installed Windows 7 Ultimate (64 bit) twice now, and each time I get on, none of the bootcamp drivers seem to be installed correctly.  This means I can't access the internet because a network adapter isn't present, and I can't play games because

  • Can't get online with 10.4.11?????

    I have a 2.16 GHz Intel iMac and updated to 10.4.11 and now I'm unable to get online w/ mail, safari, itunes, etc. I'm wireless with a Belkin N1 router. My good ol' iBook 10.3.9 is working fine, so I know my modem and router are working. I've read ot

  • Powering on a new Quad G5 ?

    I just got in a Quad, and the reality of not being able to power it on by touching the power button on my ADC monitors, just hit home. I of course have to use the ADC to DVI adapters, and my G5 is located deep under my desk. I have a bad neck, and re

  • MacBook Pro and FCP X?

    I have a MacBook Pro, 13 inch, Early 2011(2.3 GHz Intel Core i5) with 4GB memory, Intel HD Graphics 3000 384 MB graphics card.  I am running OS 10.9.4 on it.  What do I need to upgrade on the MacBook Pro to get it to work efficiently with FCP X?  Mos

  • Recompiling SYS Objects

    Hi, I am running a patch on one of our DB's so I am trying to ensure that I have no INVALID objects under the SYS schema. SQL> select object_type, count(*) from dba_objects where status='INVALID' and owner='SYS' 2 group by object_type; OBJECT_TYPE CO