<?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>topic JMS Messaging Modular Input Custom Message Handler throws java.lang.AbstractMethodError in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268202#M31007</link>
    <description>&lt;P&gt;We are running the JMS MI on on linux (Java &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; with a custom message handler.  In jms.py, a Java Exception (java.lang.AbstractMethodError) is thrown.  I am using the pattern defined in this Answer:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/310006/how-to-convert-byte-characters-coming-out-of-mq-th.html"&gt;https://answers.splunk.com/answers/310006/how-to-convert-byte-characters-coming-out-of-mq-th.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I'm not sure what interface has changed to cause this.  Is there a place we should look to debug this?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Mike&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2016 18:33:12 GMT</pubDate>
    <dc:creator>mcormier_splunk</dc:creator>
    <dc:date>2016-02-03T18:33:12Z</dc:date>
    <item>
      <title>JMS Messaging Modular Input Custom Message Handler throws java.lang.AbstractMethodError</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268202#M31007</link>
      <description>&lt;P&gt;We are running the JMS MI on on linux (Java &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; with a custom message handler.  In jms.py, a Java Exception (java.lang.AbstractMethodError) is thrown.  I am using the pattern defined in this Answer:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/310006/how-to-convert-byte-characters-coming-out-of-mq-th.html"&gt;https://answers.splunk.com/answers/310006/how-to-convert-byte-characters-coming-out-of-mq-th.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I'm not sure what interface has changed to cause this.  Is there a place we should look to debug this?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2016 18:33:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268202#M31007</guid>
      <dc:creator>mcormier_splunk</dc:creator>
      <dc:date>2016-02-03T18:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: JMS Messaging Modular Input Custom Message Handler throws java.lang.AbstractMethodError</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268203#M31008</link>
      <description>&lt;P&gt;Did you compile your custom handler with Java 7 ?&lt;/P&gt;

&lt;P&gt;The 0033 hex in the compiled class file means was compiled with Java 7. So if you compiled with Java 8 , I think that is the cause of your error message. You can still run with Java 8 after compiling with Java 7.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1032iE1D5368F0D1692B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 00:34:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268203#M31008</guid>
      <dc:creator>Damien_Dallimor</dc:creator>
      <dc:date>2016-02-04T00:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: JMS Messaging Modular Input Custom Message Handler throws java.lang.AbstractMethodError</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268204#M31009</link>
      <description>&lt;P&gt;I compiled the custom message handler with Java 8.  I will recompile with Java 7 and see if that works.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 00:59:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268204#M31009</guid>
      <dc:creator>mcormier_splunk</dc:creator>
      <dc:date>2016-02-04T00:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: JMS Messaging Modular Input Custom Message Handler throws java.lang.AbstractMethodError</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268205#M31010</link>
      <description>&lt;P&gt;I have recompiled the handler with Java 7, and am using Java 7 on the linux box.  Same error occurs (see output below).  What would be the next step to debugging this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;02-04-2016 10:49:02.427 -0500 ERROR ExecProcessor - message from "python /web/splunk/etc/apps/jms_ta/bin/jms.py" Exception in thread "Thread-3" java.lang.AbstractMethodError: com.splunk.modinput.jms.AbstractMessageHandler.handleMessage(Ljavax/jms/Message;Lcom/splunk/modinput/jms/JMSModularInput$MessageReceiver;)Lcom/splunk/modinput/Stream;

02-04-2016 10:49:02.427 -0500 ERROR ExecProcessor - message from "python /web/splunk/etc/apps/jms_ta/bin/jms.py"        at com.splunk.modinput.jms.JMSModularInput$MessageReceiver.streamMessageEvent(Unknown Source)

02-04-2016 10:49:02.427 -0500 ERROR ExecProcessor - message from "python /web/splunk/etc/apps/jms_ta/bin/jms.py"        at com.splunk.modinput.jms.JMSModularInput$MessageReceiver.browseQueue(Unknown Source)

02-04-2016 10:49:02.427 -0500 ERROR ExecProcessor - message from "python /web/splunk/etc/apps/jms_ta/bin/jms.py"        at com.splunk.modinput.jms.JMSModularInput$MessageReceiver.run(Unknown Source)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2016 15:54:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268205#M31010</guid>
      <dc:creator>mcormier_splunk</dc:creator>
      <dc:date>2016-02-04T15:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: JMS Messaging Modular Input Custom Message Handler throws java.lang.AbstractMethodError</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268206#M31011</link>
      <description>&lt;P&gt;Adding sanitized source code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tsys.convertjmsbinary;

import com.splunk.modinput.SplunkLogEvent;
import com.splunk.modinput.jms.AbstractMessageHandler;
import com.splunk.modinput.jms.JMSModularInput.MessageReceiver;
import java.util.Map;
import javax.jms.BytesMessage;
import javax.jms.JMSException;
import javax.jms.Message;

public class jmsConvertToBinary extends AbstractMessageHandler {

public fieldManager fM = null;
public String fileName = null;


@Override
public void handleMessage(Message message, MessageReceiver context)
        throws Exception {

    SplunkLogEvent splunkEvent = buildCommonEventMessagePart(message, context);

    String bodyContent = convertToBinary(message);
    splunkEvent.addPair("msg_body", bodyContent);

    String text = splunkEvent.toString();
    transportMessage(text,String.valueOf(System.currentTimeMillis()),"");
}

private String convertToBinary(Message message) {

    BytesMessage msg;
    String decodedContent = "";
    byte[] data;

    //write some code to get the message content and decode it
    if (fM == null)
        return("no message format file");

    msg = (BytesMessage) message;
    try {
        data = new byte[(int) msg.getBodyLength()];
        msg.readBytes(data);
        if (fM != null)
            decodedContent = fM.convertBytesToFields(data);
    } catch (JMSException ex) {
        System.err.println("JMS Exception: " + ex.getMessage());
    }  
    return(decodedContent);
}

@Override
public void setParams(Map&amp;lt;String, String&amp;gt; params) {
    // Do nothing , params not used
    fileName = params.get("msg.format.file");
    if (fileName != null)
        fM = new fieldManager(fileName);
    else
        fM = null;
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 16:32:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268206#M31011</guid>
      <dc:creator>mcormier_splunk</dc:creator>
      <dc:date>2016-02-04T16:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: JMS Messaging Modular Input Custom Message Handler throws java.lang.AbstractMethodError</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268207#M31012</link>
      <description>&lt;P&gt;I simplified this as much as possible (see code below), and even copied the class AbstractMessageHandler.java into the package, recompiled with Java 7 and we still get the following error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;02-04-2016 16:10:02.947 -0500 ERROR ExecProcessor - message from "python /web/splunk/etc/apps/jms_ta/bin/jms.py" Exception in thread "Thread-3" java.lang.AbstractMethodError: com.splunk.modinput.jms.AbstractMessageHandler.handleMessage(Ljavax/jms/Message;Lcom/splunk/modinput/jms/JMSModularInput$MessageReceiver;)Lcom/splunk/modinput/Stream;

02-04-2016 16:10:02.947 -0500 ERROR ExecProcessor - message from "python /web/splunk/etc/apps/jms_ta/bin/jms.py"        at com.splunk.modinput.jms.JMSModularInput$MessageReceiver.streamMessageEvent(Unknown Source)

02-04-2016 16:10:02.947 -0500 ERROR ExecProcessor - message from "python /web/splunk/etc/apps/jms_ta/bin/jms.py"        at com.splunk.modinput.jms.JMSModularInput$MessageReceiver.browseQueue(Unknown Source)

02-04-2016 16:10:02.947 -0500 ERROR ExecProcessor - message from "python /web/splunk/etc/apps/jms_ta/bin/jms.py"        at com.splunk.modinput.jms.JMSModularInput$MessageReceiver.run(Unknown Source)

package com.tsys.jms;

import com.splunk.modinput.SplunkLogEvent;
import com.splunk.modinput.jms.AbstractMessageHandler;
import com.splunk.modinput.jms.JMSModularInput.MessageReceiver;
import java.util.Map;
import javax.jms.Message;

public class BinaryToText extends AbstractMessageHandler {


@Override
public void handleMessage(Message message, MessageReceiver context)
        throws Exception {

    SplunkLogEvent splunkEvent = buildCommonEventMessagePart(message, context);

    String bodyContent = "Hello World";
    splunkEvent.addPair("msg_body", bodyContent);

    String text = splunkEvent.toString();
    transportMessage(text,String.valueOf(System.currentTimeMillis()),"");
}

@Override
public void setParams(Map&amp;lt;String, String&amp;gt; params) {
    // Do nothing , params not used
}
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2016 21:18:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268207#M31012</guid>
      <dc:creator>mcormier_splunk</dc:creator>
      <dc:date>2016-02-04T21:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: JMS Messaging Modular Input Custom Message Handler throws java.lang.AbstractMethodError</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268208#M31013</link>
      <description>&lt;P&gt;What was the Solution to this?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 08:21:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/JMS-Messaging-Modular-Input-Custom-Message-Handler-throws-java/m-p/268208#M31013</guid>
      <dc:creator>effem2</dc:creator>
      <dc:date>2020-04-01T08:21:02Z</dc:date>
    </item>
  </channel>
</rss>

