Idl to java mapping problems

i have a datatype i created on the server. On the server is a method that returns that datatype in a array. How can i sepecify in the idl that the return type is a special datatype and that it is also an array.

try to use "sequence" to do that.

Similar Messages

  • Java Mapping problem...

    Hi Guru’s,
    I am using the Java mapping in my XI system and it works fine in my Development.
    I just moved all my objects in to QA and I am getting some problem in my Java mapping.  It is not behaving like the dev the output format.
    Is their anything have to do for Java mapping while importing in to the QA system.
    I did the file transport and imported in to my QA.
    Please give me your comments and solution to resolve this issue.
    Thanks,
    Jane.

    Getting the below error in my response.
    - <ResponseMessage>
    - <Status>
      <StatusCode>500</StatusCode>
      <StatusText>Error while parsing the input</StatusText>
    - <Errors>
    - <Error type="Error">
      <ErrorMessage>Fatal Error: Internal server error - 1187224995259871</ErrorMessage>
      </Error>
      </Errors>
      </Status>
      </ResponseMessage>
    Thanks,
    Jane.

  • Problem in Java Mapping

    Hi,
          I was trying out a simple Java mapping example.
    Example of source structure is -
    <?xml version="1.0"?>
    <ns0:MT_SRC xmlns:ns0="http://www.sap-press.com/xi/training/00">
    <organization>
    <employee>
    <firstname>Jack</firstname>
    <lastname>Rose</lastname>
    </employee>
    <employee>
    <firstname>Paul</firstname>
    <lastname>McNealy</lastname>
    </employee>
    <employee>
    <firstname>Vaibhav</firstname>
    <lastname>Pandey</lastname>
    </employee>
    </organization>
    </ns0:MT_SRC>
    Example of target structure is -
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_TRGT xmlns:ns0="http://www.sap-press.com/xi/training/00"><Organization><employee><name>JackRose</name></employee><employee><name>PaulMcNealy</name></employee><employee><name>VaibhavPandey</name></employee></Organization></ns0:MT_TRGT>
    and here's the code I'm using
    package com.mapping;
    import java.io.*;
    import java.util.Map;
    import java.util.HashMap;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    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 org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.api.MappingTrace;
    import com.sap.aii.mapping.api.StreamTransformation;
    public class JavaMap implements StreamTransformation{
         private Map param = null;
            private MappingTrace  trace = null;
            public void setParameter (Map param) {
                this.param = param;
                if (param == null) {
                    this.param = new HashMap();
            public void execute(InputStream in, OutputStream out) {
                   OutputStreamWriter buf_writer = new OutputStreamWriter(out);        
                   InputStreamReader buf_reader = new InputStreamReader(in);
                   String mat = new String();
                   String extmat = new String();
                   try {
                        buf_writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>" ,0,56);
                        buf_writer.write("<ns0:MT_TRGT xmlns:ns0=\"http://www.sap-press.com/xi/training/00\">");
                        buf_writer.write("<Organization>",0,20);
                        buf_writer.flush();
                  } catch(IOException e){};
                  try {
                       DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();          
                       factory.setValidating(false);          
                       DocumentBuilder builder = factory.newDocumentBuilder();          
                       Document doc = builder.parse(in);
                        String fname = null;
                        String lname = null;
                        doc.getDocumentElement().normalize();
                        //System.out.println("Root element " + doc.getDocumentElement().getNodeName());
                        NodeList nodeLst = doc.getElementsByTagName("employee");
                        //System.out.println("Information of all employees");
                        for (int s = 0; s < nodeLst.getLength(); s++) {
                        Node fstNode = nodeLst.item(s);
                        if (fstNode.getNodeType() == Node.ELEMENT_NODE) {
                             buf_writer.write("<employee>");     
                        Element fstElmnt = (Element) fstNode;
                        NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("firstname");
                        Element fstNmElmnt = (Element) fstNmElmntLst.item(0);
                        NodeList fstNm = fstNmElmnt.getChildNodes();
                        //System.out.println("First Name : " + ((Node) fstNm.item(0)).getNodeValue());
                        fname = fstNm.item(0).getNodeValue();
                        NodeList lstNmElmntLst = fstElmnt.getElementsByTagName("lastname");
                        Element lstNmElmnt = (Element) lstNmElmntLst.item(0);
                        NodeList lstNm = lstNmElmnt.getChildNodes();
                        //System.out.println("Last Name : " + ((Node) lstNm.item(0)).getNodeValue());
                        lname = lstNm.item(0).getNodeValue();
                        buf_writer.write("<name>"fname" "lname"</name>");
                        buf_writer.write("</employee>");
                        buf_writer.write("</Organization>");
                        buf_writer.write("</ns0:MT_TRGT>");
                        TransformerFactory tFactory = TransformerFactory.newInstance();
                     Transformer transformer = tFactory.newTransformer();
                     transformer.setOutputProperty("indent", "yes");
                     DOMSource source = new DOMSource(doc);
                     StreamResult result = new StreamResult(out);
                     transformer.transform(source, result);
                        } catch (Exception e) {
                        e.printStackTrace();
    However, when I'm testing my Interface mapping, I'm getting the following error -
    Call method execute of the application Java mapping com.mapping.JavaMap
    Error during appliction Java mapping com/mapping/JavaMap
    java.lang.StringIndexOutOfBoundsException at java.lang.String.getChars(String.java:672)
    Could anyone please help me out with this?
    Thanks and Regards,
    Shiladitya

    HI,
    It looks to be that your JavaMap class have one field whihc will be not getting the proper value as input thus its creating the array Index out of bound exception.
    Please can you verify if you have assigned the proper String size for all the fields.
    Or probably you are getting the blank value which have created the execption.
    Also can you narrow down and let me know about the line String.getChars(String.java:672)
    Here you have used the try and catch option but may be the exact line no. can give better idea about the problem.
    Thanks
    swarup

  • Problems with Java Mapping in Bpm

    Hello to All.
    I have a simple scenario...
    1) Receiver ( XML1)
    2) Transformation
    3) Sender (XML3)
    I have 3 variables.  
    Variable 1  XML1
    Variable 2  XML2
    Variable 3  XML3
    In my transformation have two source.. an XML and XML2 and my mapping program is java mapping.
    The java mapping modify the XML1 according the XML2 and transform in XML3.
    When I run BPM . I have problem , because the flow stop in transformation.

    Yes I have tested. But I found the solution.. The java mapping generate a header like <xsi : Message1></>... <xsi : Message2> </>
    Thanks.

  • Problem in SAX Java mapping

    Hi,
    I'm using SAX Java mapping in one scenario. Problem is when I get some Croatina characters, like Đ or u0160,
    output XML is not valid. XML Spy complains, IE complains and so on. Customer is sure  that data ( XML in CLOB field in Oracle DB) is UTF-8? What could be a problem?
    What I'm doing is reading entire XML into string with help of BufferedReader, then do some manipulation and write String into byte array with:
                   byte[] bytes = file.toString().getBytes("UTF-8");
                   saxParser.parse(new ByteArrayInputStream(bytes), handler);
    and then of course parse XML. readLine method reads data and problematic is "Ä�" - ￯0 - 0xC490.
    For this character XML Spy doesn't complain, IE also. After conversion, this character looks like "Ä?" - 0xC43F, and this is not good any more. Why?

    Hi Stefan,
    I've finally done it. Code as foollws:
         public void execute(InputStream in, OutputStream out)
                   throws com.sap.aii.mapping.api.StreamTransformationException {
              DefaultHandler handler = this;
              SAXParserFactory factory = SAXParserFactory.newInstance();
              try {
                   SAXParser saxParser = factory.newSAXParser();
                   fStreamOut = new BufferedWriter(new OutputStreamWriter(out, "UTF-8"));
                   encoding = "UTF-8";
                   if (map != null) {
                        mappingTrace = (MappingTrace) map
                                  .get(StreamTransformationConstants.MAPPING_TRACE);
                   InputStreamReader is = new InputStreamReader(in, "UTF8");
                   BufferedReader reader = new BufferedReader(is);
                   StringBuffer file = new StringBuffer();
                   String line = new String();
                   try {
                        while ((line = reader.readLine()) != null) {
                             file.append(line);
                   } catch (IOException e) {
                        e.printStackTrace();
                   } finally {
                        try {
                             in.close();
                        } catch (IOException e) {
                             e.printStackTrace();
                   Date d4 = new Date();
                   file = replaceREGEX(
                             "<\\?xml version=\"1\\.0\" encoding=\"UTF-8\"\\?>", "",
                             file);
                   char[] cArray = file.toString().toCharArray();
                   Date filedat = new Date();;
                   SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd_HHmmss_SSS");
                   String fName = df.format(filedat) + "_El_Invoice.xml";
                   Writer out1 = new BufferedWriter(new OutputStreamWriter(
                             new FileOutputStream(fName), "UTF8"));
                   try {
                        out1.write(file.toString().toCharArray());
                        out1.close();
                   } catch (UnsupportedEncodingException e) {
                   } catch (IOException e) {
                   saxParser.parse(fName, handler);
                   File outFile = new File(fName);
                   outFile.delete();
              } catch (Throwable t) {
                   if (mappingTrace != null) {
                        mappingTrace.addInfo(t.toString());
                   t.printStackTrace();
    problem was also in method for writing in output stream, so I've changed it:
         private void printOutPut(String sOP) {
              try {
                      //    fStreamOut.write(sOP.getBytes());
                   fStreamOut.write(sOP);
              } catch (IOException e) {
                   e.notify();

  • Strange problem with jars in Java Mapping

    Hi All,
    I'm trying to implement a Java Mapping that uses Xerces. I'm using xercesImpl.jar.
    I put the xercesImpl.jar file in the folder containing the .class file (the Java Mapping program), and zipped the folder.I imported the zip file as an archive and used it in the Interface Mapping.
    My code uses the org.apache.xerces.parsers.<b>SAXParser</b> class.
    However, while trying to execute the Interface Mapping, it gives error: <b>Unable to find resource:'org/apache/xerces/parsers/SAXParser.class'</b>.
    The same method works when I'm using xerces.jar and using classes javax.xml.parsers.<b>DocumentBuilder</b> and
    javax.xml.parsers.DocumentBuilderFactory.
    I can't figure out what the problem is.
    Any ideas?
    Regards,
    Puloma.

    Hi All,
    I tried all the methods suggested. Mow my problem is that I get the following error, when I try to instantiate the SAXParser class:
    Unable to find resource:
    <b>META-INF/services/org.apache.xerces.xni.parser.XMLParserConfiguration</b>
    The XMLParserConfiguration class is actually in org.apache.xerces.xni.parser. Why does XI try to find it in the wrong sub-directory?
    My code works just fine on standalone.
    Regards,
    Rahul.

  • Problem by adding attachments in Java Mapping

    Hi,
    we have to add some attachments in Java Mapping.
    So we are using the Java Mapping API.
    But it doesn't work correctly.
    We got the following error in sxmb_moni:
    Attribute Manifest ExampleAttachment is initial
    So we checked what happened in the Manifest and in the SAP SOAP Envelope and we see that there is an inconsistence.
    In the SAP Manifest we find the following entries:
    <SAP:Manifest xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:wsu="http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="wsuid-manifest-5CABE13F5C59AB7FE10000000A1551F7">
         <SAP:Payload xlink:href="cid:payload-79a6e3c088db11dfa4dd0017a477c1e8<at>sap.com">
              <SAP:Name>MainDocument</SAP:Name>
              <SAP:Description/>
              <SAP:Type>Application</SAP:Type>
         </SAP:Payload>
         <SAP:Payload xlink:href="ExampleAttachment">
              <SAP:Name>ExampleAttachment</SAP:Name>
              <SAP:Description/>
              <SAP:Type>ApplicationAttachment</SAP:Type>
         </SAP:Payload>
    </SAP:Manifest>
    For us it seems the entry for our ExampleAttachment is wrong. I think there must be a real content id for the attachment like the cid for the MainDocument. In the SOAP Envelope you can find the following entry for the attachment:
    content-type:text/plain
    content-length:45
    content-id:payload-79a6e3c088db11dfa4dd0017a477c1e8<at>sap.com
    This is an example for an attachment!
    --SAP_0017A477C1EC1DEFA3D200A5CB55CE04_END--
    So here you can see a real content ID, but you can't find it in the Manifest.
    So do we anything wrong in our source code or is it a bug of the SAP API?
    Do you have any ideas?
    Here the Java Mapping we're using for adding an attachment (as a test):
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.DynamicConfiguration;
    import com.sap.aii.mapping.api.DynamicConfigurationKey;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    import com.sap.aii.mapping.api.Attachment;
    public class SUSAttaHandler extends AbstractTransformation {
         private static final DynamicConfigurationKey KEY_FILENAME    = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
         // Transform Method
         public void transform(TransformationInput in, TransformationOutput out)
                   throws StreamTransformationException {
              // An info message is added to trace
              getTrace().addWarning("JAVA Mapping AttaHandler called!");
              // Input payload
              String inData = convertStreamToString(in.getInputPayload().getInputStream());
              // dynamic configuration
              DynamicConfiguration conf = in.getDynamicConfiguration();
              String fileName          = conf.get(KEY_FILENAME);
              getTrace().addWarning("AttaHandler: FileName = " + fileName);
              String text = new String("This is an example for an attachment!");
              Attachment atta = out.getOutputAttachments().create("ExampleAttachment", "text/plain", text.getBytes());
              out.getOutputAttachments().setAttachment(atta);
              String outData = inData;
              try {
                   out.getOutputPayload().getOutputStream().write(outData.getBytes("UTF-8"));
              catch(Exception exception1) { }
         // convert Stream to String
         public String convertStreamToString(InputStream in){
              StringBuffer sb = new StringBuffer();
              try {
                   InputStreamReader isr = new InputStreamReader(in);
                   Reader reader = new BufferedReader(isr);
                   int ch;
                   while((ch = in.read()) > -1) {
                        sb.append((char)ch);}
                        reader.close();
              } catch(Exception exception) { }
              return sb.toString();
    Thanks for your help,
    Thorsten

    Hi,
    we created an OSS ticket for this problem and SAP created a SAP note.
    Here the number of the note: 0001501345
    I hope this will help you.
    Thorsten

  • IDL to JAVA - problem with enum, const assignment

    Hi,
    I have a problem with compile IDL to JAVA.
    I want to compile foo.idl to java by command:
    idlj foo.idl foo.idl:
        enum color {
          blue,
          red,
          green,
          yelow
        const color DEFAULT_COLOR = blue;But I get errors:
    foo.idl (line 8):  The type of  is enumeration, but it should be primitive or string.
    const color DEFAULT_COLOR = blue;
    foo.idl (line 8):  Identifiers in constant expressions must be constants, not blue.
    const color DEFAULT_COLOR = blue;I don't think that IDL file (foo.idl) is wrong, because I compile this file to c and python without errors.
    Can you help me?

    Let's take this one step at a time.
    1. You have successfully configured ABAP/Java communication using template installer? See note 917590.
    2. Did you assign the portal user appropriate portal roles?
    3. Can you start a web query from 7.0 query designer?

  • How to map idl to java for "union" type

    help me

    I'm not exactly sure what you're asking for. If you've written IDL that uses an IDL union type, it will be converted to Java when you use your IDL to Java compiler (like idlj), right?
    If you're looking for the specification on how the compiler does/should do it, get the latest IDL to Java language mapping from the OMG -- www.omg.org.

  • Problem in java mapping - request reject when enter to the XI

    hello
    I have WS 2 RFC with JAVA MAPPING. I try to run it and recieve an error in the sxmb:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="MAPPING">JCO_SYSTEM_FAILURE</SAP:Code>
      <SAP:P1>Exception in method processFunction.</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>&quot;SYSTEM FAILURE&quot; during JCo call. Exception in method processFunction.</SAP:Stack>
      <SAP:Retry>N</SAP:Retry>
      </SAP:Error>
    in the xml spy the return is:
                             <text><![CDATA[
    com.sap.aii.af.ra.ms.api.DeliveryException: XIServer:JCO_SYSTEM_FAILURE:
         at com.sap.aii.adapter.xi.ms.XIEventHandler.onTransmit(XIEventHandler.java:455)
         at com.sap.aii.af.ra.ms.impl.core.queue.CallConsumer.onMessage(CallConsumer.java:133)
         at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:850)
         at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)
         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:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
              ]]></text>
    any suggestion why the xi doesnt recieve the request:
    Thanks
    Kfir

    Test RFC destination AI_RUNTIME_JCOSERVER. You may delete and recreate it.
    how exactly do I test it? in the XID or the SAP DEV?
    how can I delete and recreate?
    since I never did it, details will be appreciated.
    Kfir

  • Problem with Java Mapping

    Hello experts,
    I developed a Java Mapping Programm for reading filename of a pdf file and giving filename to a rfc structure for calling a rfc module. Thus, I test it via testing interface method and implementing a main method in my mapping class, which works, but if I run it in the integration server  I get the following exception:
    MP: Exception caused of com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7: com.sap.aii.af.rfc.afcommunication.RfcAFWException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7
    That is the execute method of my class:
         public void execute(InputStream inputStream, OutputStream outputStream)
              throws StreamTransformationException {
              // TODO Auto-generated method stub
              try { //The following is for the FileName in the File Adapter
                   DynamicConfiguration dynamicconfiguration =
                        (DynamicConfiguration) map.get("DynamicConfiguration");
                   DynamicConfigurationKey key =
                        DynamicConfigurationKey.create(
                             "http://sap.com/xi/XI/System/File",
                             "FileName");
                   String myFileName = dynamicconfiguration.get(key);
                   MappingTrace trace = null;
                   trace.addInfo(myFileName);
                   DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                   DocumentBuilder db = dbf.newDocumentBuilder();
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer transform = tf.newTransformer();
                   Document docout = db.newDocument();
                   Element root = docout.createElement("Z_SD_WEB_HP_INVOICE_STATUS");
                   root.setAttribute(
                        "xmlns:ns1",
                        "urn:sap-com:document:sap:rfc:functions");
                   docout.appendChild(root);
                   Element docName = docout.createElement("IM_DOCNAME");
                   root.appendChild(docName);
                   Text srcxml = docout.createTextNode(myFileName);
                   docName.appendChild(srcxml);
                   DOMSource domS = new DOMSource(docout);
                   transform.transform((domS), new StreamResult(outputStream));
              } catch (Throwable throwable) {
                   throwable.printStackTrace();
    If I test via main method and testing interface mapping  the generated xml is like:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?><Z_SD_WEB_HP_INVOICE_STATUS xmlns:ns1="urn:sap-com:document:sap:rfc:functions"><IM_DOCNAME>232132.pdf</IM_DOCNAME></Z_SD_WEB_HP_INVOICE_STATUS>
    I do not understand why I get this error in real environment.
    Kind regards,
    Erkan

    Hello experts,
    I found the solution. I will also publish this solution, this is also a point which I sometimes missing here in this forum:
    In creating the rfc-xml with java mapping, so a prefix should be add to the name of the rfc-structure e.g.
    ns1:Z_RFC_CALL. If this prefix is missing, then you get this error:
    com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7: com.sap.aii.af.rfc.afcommunication.RfcAFWException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7
    To find this I create a grafical test mapping and I check the test rfc-xml with the java created xml.
    Anyway thanks all for the published recommendations.
    Kind regards,
    Erkan

  • Problem in Uploading Java mapping Code

    Hi Guys,
                  I never work on Java mapping before, i got the code required for my progrmme in these forums.So i saved it as a text file. now i want to import that fileintomy programme as Java class. i think i have to use Netweaver Studio. what exactly i have o do it.
    Thanks in advance.
    Kartik

    Hello Kartik,
    If your code is handling the Required Mapping.Then what is you need to do is  :
    Create the Jar file using any Java IDE (or) use Netweaver developer studio.
    Before creating the u201Cjaru201D file just make sure that the "path" of the class file in the imported archive. It should be the
    same as your "package" path.
    Once the class file is created, we have to create the jar file with all the necessary files. After creating the jar file, it
    has to be deployed to XI.
    Import the Jar file using Imported Archive  in IR under Mapping Objects.
    See this blog it explains how to load :
    Java Mapping (Part III)
    After doing the necessary setps you can test the Mapping.
    regards
    Gangaprasad

  • Error while doing java mapping

    Hi,
    I have written a java mapping code .But i have a small doubt when i compile it it is showing errors that package com.sap.aii.mapping.api does not exist.How can i solve the problem.Please help me in this issue.
    Thanks,
    Bhargav

    Hi ,
    check this thread, it may help you.
    https://forums.sdn.sap.com/click.jspa?searchID=3558715&messageID=3229273
    Regards,
    Ramesh.

  • Linkage error while doing java mapping

    Hi,
    I Have written a java mapping but when i use it in xi.It is showing an error as linkage error
    LinkageError at JavaMapping.load(): Could not load class: com/satyam/nestle/JavaMap
    Can anyone explain what does this mean and how to overcome it.
    Thanks in advance,
    Bhargav

    Did you try testing the java mapping seperately....that it does not have any errors??? Also check the cahce update. Sometimes it happens that XI is not able to load the class file from the cache. Perform a CPA cache refresh (delta). This should solve the problem
    Reward if helpful.

  • Keystore access in Java Mapping Program - user J2EE_GUEST

    Dear Gurus,
    I have the following problem:
    I need to validate the digital signature of a XML document and I'm using some examples provided by SAP as follows:
              InitialContext ctx = ctx = new InitialContext();          
              Object o = (Object) ctx.lookup("keystore");          
              KeystoreManager manager = (KeystoreManager) o;          
              KeyStore ks = manager.getKeystore("Serasa");
    {/code}
    But I get the error below, saying that user J2EE_GUEST is not authorized. How do I change the user who executes java mapping, because I granted permissions in Visual Admin to another user.
         at com.sap.aii.ibrun.sbeans.mapping.MappingServiceObjectImpl0_0.processFunction(MappingServiceObjectImpl0_0.java:131)
         at sun.reflect.GeneratedMethodAccessor267.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:62)
         at java.lang.reflect.Method.invoke(Method.java:391)
         at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
         at $Proxy218.processFunction(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor266.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:62)
         at java.lang.reflect.Method.invoke(Method.java:391)
         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(AccessController.java:219)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)
    Caused by: com.sap.engine.services.keystore.exceptions.BaseKeystoreException: User is not authorized to execute keystore operation[{GET_VIEW Serasa }]
         at com.sap.engine.services.keystore.impl.security.UserBasedSecurityConnector.checkUserPermission(UserBasedSecurityConnector.java:889)
         at com.sap.engine.services.keystore.impl.security.SecurityRestrictionsChecker.checkUserPermission(SecurityRestrictionsChecker.java:52)
         at com.sap.engine.services.keystore.impl.security.SecurityRestrictionsChecker.isUserAuthorized(SecurityRestrictionsChecker.java:148)
         at com.sap.engine.services.keystore.impl.security.SecurityRestrictionsChecker.checkPermission(SecurityRestrictionsChecker.java:174)
         at com.sap.engine.services.keystore.impl.ParameterChecker.checkPermission(ParameterChecker.java:35)
         at com.sap.engine.services.keystore.impl.KeystoreManagerImpl.checkPermission(KeystoreManagerImpl.java:46)
         ... 28 more
    Caused by: java.security.KeyStoreException: (thread: SAPEngine_Application_Thread[impl:3]_56,view:Serasa, entry: , user: J2EE_GUEST) - checkPermissions  'getView': com.sap.engine.services.security.exceptions.BaseSecurityException: Caller not authorized.
         at com.sap.engine.services.keystore.impl.security.UserBasedSecurityConnector.checkFailed(UserBasedSecurityConnector.java:1097)
         at com.sap.engine.services.keystore.impl.security.UserBasedSecurityConnector.checkPermissions_getView(UserBasedSecurityConnector.java:773)
         at com.sap.engine.services.keystore.impl.security.UserBasedSecurityConnector.checkUserPermission(UserBasedSecurityConnector.java:823)
         ... 33 more
    {/code}
    Thank you very much

    Hi Fabio,
    first of all have you checked if standard functions to verify digital signature for pi adpaters would work for you?
    We have used the following code to access the Keystore in a custom adapter. It accesses the keystore with the access rights of a JEE application (it has a reference to the sample adapter "sap.com/com.sap.aii.adapter.sample.ra"). Check out if it works in your mapping, too.
    import java.security.Key;
    import java.security.KeyStore;
    import java.security.KeyStoreException;
    import java.security.NoSuchAlgorithmException;
    import java.security.PublicKey;
    import java.security.UnrecoverableKeyException;
    import java.util.HashMap;
    import java.util.Map;
    import javax.resource.ResourceException;
    import com.sap.aii.af.service.resource.SAPSecurityResources;
    import com.sap.aii.security.lib.KeyStoreManager;
    import com.sap.aii.security.lib.PermissionMode;
    public class XIKeystoreAccessor {
        private static final XITrace TRACE = new XITrace(XIKeystoreAccessor.class.getName());
        static XIKeystoreAccessor instance = null;
        SAPSecurityResources securityResources;
        KeyStoreManager keystoreManager;
        Map<String, KeyStore> keystores = null;
        private XIKeystoreAccessor() throws ResourceException {
         final String SIGNATURE = "XIKeystoreAccessor()";
         TRACE.entering(SIGNATURE);
         keystores = new HashMap<String, KeyStore>();
         securityResources = SAPSecurityResources.getInstance();
         try {
             keystoreManager = securityResources.getKeyStoreManager(PermissionMode.SYSTEM_LEVEL,
                  new String[] { "sap.com/com.sap.aii.adapter.sample.ra" });
         } catch (KeyStoreException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
         TRACE.exiting(SIGNATURE);
         * Get a key from AS Java keystore
         * @param view
         * @param alias
         * @param password
         * @return
         * @throws ResourceException
        public Key getPrivateKey(String view, String alias, String password) throws ResourceException {
         final String SIGNATURE = "getPrivateKey()";
         TRACE.entering(SIGNATURE);
         KeyStore keystore = getKeystore(view);
         Key privateKey = null;
         try {
             privateKey = keystore.getKey(alias, password.toCharArray());
             if (privateKey == null) {
              throw new ResourceException("Key not found. alias=" + alias);
         } catch (KeyStoreException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
         } catch (NoSuchAlgorithmException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
         } catch (UnrecoverableKeyException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
         TRACE.exiting(SIGNATURE);
         return privateKey;
        public PublicKey getPublicKey(String view, String alias) throws ResourceException {
         final String SIGNATURE = "getPublicKey()";
         TRACE.entering(SIGNATURE);
         KeyStore keystore = getKeystore(view);
         PublicKey publicKey = null;
         try {
             publicKey = keystore.getCertificate(alias).getPublicKey();
             if (publicKey == null) {
              throw new ResourceException("Key not found. alias=" + alias);
         } catch (KeyStoreException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
         TRACE.exiting(SIGNATURE);
         return publicKey;
         * Get a keystore i.e. a view from AS Java
         * @param view
         * @return
         * @throws ResourceException
        public KeyStore getKeystore(String view) throws ResourceException {
         final String SIGNATURE = "getKeystore()";
         TRACE.entering(SIGNATURE);
         KeyStore keystore;
         try {
             if (keystores.containsKey(view) == true) {
              keystore = keystores.get(view);
             } else {
              keystore = keystoreManager.getKeyStore(view);
              if (keystore == null) {
                  throw new ResourceException("Keystore not found. view=" + view);
              keystores.put(view, keystore);
             TRACE.exiting(SIGNATURE);
             return keystore;
         } catch (KeyStoreException e) {
             TRACE.catching(SIGNATURE, e);
             throw new ResourceException(e);
        static public XIKeystoreAccessor getInstance() throws ResourceException {
         if (instance == null) {
             instance = new XIKeystoreAccessor();
            return instance;

Maybe you are looking for

  • Multiple Firewire Connections on a MAC PRO 2008

    Wondering if anyone knows if there are any issues with multiple firewire inputs on a MAC PRO? I will be downloading film footage as well as running a Presonus Inspire for Voice-Overs which also uses a firewire connection to the computer.

  • Error while tyring to do Delta Load

    Hi Friends, I have created a custom datasource and have made it delta capable by adding a date field in the generic delta option. The datasource shows that it is delta enabled. However when I go to RSA3 and try to extract the data with any other meth

  • I cant get my messaging to work on my ipod touch...can you help me?

    how do i get the messaging to work on my ipod?

  • Account disabled

    I had an un-authorized purchas on my account a couple of moths ago. I disputed it and we're good. Now when I try to make another authorized purchase the iTunes store tells me my account is disabled even though I reset my password. please help

  • Customizing Bank details in ESS

    Hi, I am looking for how to hide a field in infotype 9. (fieldname EMFTX) Is it possible to hide this field only in ESS or do I have to use table v_T588M? Best regards Kjersti