<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Payload Logging with Groovy Script: java.lang.NoSuchMethodException: No signature of method in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548767#M116370</link>
    <description>&lt;P&gt;Is there really a Need for logging the payload with Groovy script? I'm quite new to SCPI, so be lenient with me, if you happen to be able to reproduce the wanted message at any time, traceing might be easier, especially since it will persist payload at any message step. Backdraw would be, that it is only on for 10 minutes, so no Long term logging there.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Sep 2017 06:56:26 GMT</pubDate>
    <dc:creator>JaySchwendemann</dc:creator>
    <dc:date>2017-09-12T06:56:26Z</dc:date>
    <item>
      <title>Payload Logging with Groovy Script: java.lang.NoSuchMethodException: No signature of method</title>
      <link>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaq-p/548765</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;I am trying to log payloads in an integration flow using the following code in a groovy script step:import com.sap.gateway.ip.core.customdev.util.Message;&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
    def body = message.getBody(java.lang.String) as String;
    def messageLog = messageLogFactory.getMessageLog(message);
    if(messageLog != null){
        messageLog.addAttachmentAsString("Payload", body, "text/plain");
     }
    return message;
}

&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;When executing the integration flow the following error appears in monitoring:&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;Message processing failed. &lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt; &lt;EM&gt;java.lang.NoSuchMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.Log message payload() is applicable for argument types: (com.sap.gateway.ip.core.customdev.processor.MessageImpl) values: [com.sap.gateway.ip.core.customdev.processor.MessageImpl@5b15080c]&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;Does anyone have an idea what is causing this or if there is a problem in the code itself?&lt;/P&gt;
  &lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2017 18:28:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaq-p/548765</guid>
      <dc:creator>floriangu</dc:creator>
      <dc:date>2017-09-11T18:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Payload Logging with Groovy Script: java.lang.NoSuchMethodException: No signature of method</title>
      <link>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548766#M116369</link>
      <description>&lt;P&gt;Hi Florian,&lt;/P&gt;
  &lt;P&gt;Can you please post a screenshot which shows the details of your Groovy script artifact?&lt;/P&gt;
  &lt;P&gt;This piece of code works for me:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;import com.sap.gateway.ip.core.customdev.util.Message;
def Message processData(Message message) {
    def body = message.getBody(java.lang.String) as String;
    def messageLog = messageLogFactory.getMessageLog(message);
    if(messageLog != null){
        messageLog.setStringProperty("Logging#1", "Printing Payload As Attachment")
        messageLog.addAttachmentAsString("ResponsePayload1:", body, "text/plain");
     }
    return message;
}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/68656-payload-logging-1.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/68667-payload-logging-2.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;Regards,&lt;/P&gt;
  &lt;P&gt;Prasanna&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 01:03:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548766#M116369</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-09-12T01:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Payload Logging with Groovy Script: java.lang.NoSuchMethodException: No signature of method</title>
      <link>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548767#M116370</link>
      <description>&lt;P&gt;Is there really a Need for logging the payload with Groovy script? I'm quite new to SCPI, so be lenient with me, if you happen to be able to reproduce the wanted message at any time, traceing might be easier, especially since it will persist payload at any message step. Backdraw would be, that it is only on for 10 minutes, so no Long term logging there.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 06:56:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548767#M116370</guid>
      <dc:creator>JaySchwendemann</dc:creator>
      <dc:date>2017-09-12T06:56:26Z</dc:date>
    </item>
    <item>
      <title>Re: Payload Logging with Groovy Script: java.lang.NoSuchMethodException: No signature of method</title>
      <link>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548768#M116371</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;thank you for your reply. To be on the safe side I have copied your code to my Groovy Script artefact, but still get the same error.&lt;/P&gt;
  &lt;P&gt;Here are the screenshots:&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/66707-groovyscriptartefact.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/66708-groovyscriptcode.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 09:58:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548768#M116371</guid>
      <dc:creator>floriangu</dc:creator>
      <dc:date>2017-09-12T09:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Payload Logging with Groovy Script: java.lang.NoSuchMethodException: No signature of method</title>
      <link>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548769#M116372</link>
      <description>&lt;P&gt;Well there are two reasons why I would like to trace payload in the integration flow in the test environment:&lt;/P&gt;
  &lt;P&gt;1. Reproducing of the message is not easily possible on sender side&lt;/P&gt;
  &lt;P&gt;2. WebUI should be the central point of access for development / monitoring&lt;/P&gt;
  &lt;P&gt;Otherwise I agree with you.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 10:01:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548769#M116372</guid>
      <dc:creator>floriangu</dc:creator>
      <dc:date>2017-09-12T10:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Payload Logging with Groovy Script: java.lang.NoSuchMethodException: No signature of method</title>
      <link>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548770#M116373</link>
      <description>&lt;P&gt;Make sure you leave the field Script Function blank, as per my earlier screenshot.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Sep 2017 11:37:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/548770#M116373</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-09-12T11:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Payload Logging with Groovy Script: java.lang.NoSuchMethodException: No signature of method</title>
      <link>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/13671325#M4825806</link>
      <description>Nice reply , its work for me , i was facing same error</description>
      <pubDate>Mon, 15 Apr 2024 17:05:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/payload-logging-with-groovy-script-java-lang-nosuchmethodexception-no/qaa-p/13671325#M4825806</guid>
      <dc:creator>mohit_verma1</dc:creator>
      <dc:date>2024-04-15T17:05:25Z</dc:date>
    </item>
  </channel>
</rss>

