Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-7024

Event Translator cant translate events with update-field data present

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.13.4
    • Fix Version/s: 16.0.4, Meridian-2015.1.1, 17.0.0
    • Component/s: Event Translator
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Environment:
      Java Version: 1.7.0_55 Oracle Corporation
      Java Virtual Machine: 24.51-b03 Oracle Corporation
      Operating System: Linux 3.14.5-x86_64-linode42 (amd64) (Centos 6.4)
    • Sprint:
      Newts - Phase 6

      Description

      When an event is defined with update-field set, The event translator cannot clone the event. For example - an event is defined

      <event>
      <uei>uei.opennms.org/application/mobilelocation/single-working</uei>
      ...
      <alarm-data reduction-key="%uei%:%parm[workerid]%" alarm-type="1" auto-clean="false" >
      <update-field field-name="severity" update-on-reduction="true"/>
      <update-field field-name="logmsg" update-on-reduction="true"/>
      </alarm-data>
      </event>

      and an event translator translation spec is defined

      <event-translation-spec uei="uei.opennms.org/application/mobilelocation/single-working" >
      <mappings>
      <mapping>
      <assignment name="uei" type="field" >
      <value type="constant" result="uei.opennms.org/application/mobilelocation/single-working-node-updated" />
      </assignment>
      </mapping>
      </mappings>
      </event-translation-spec>

      The event translator log shows the following the error;
      2014-10-16 14:29:04,303 ERROR [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: Exception cloning event
      java.io.NotSerializableException: org.opennms.netmgt.xml.event.UpdateField

      When the following definitions are removed, the event translator works fine

      <update-field field-name="severity" update-on-reduction="true"/>
      <update-field field-name="logmsg" update-on-reduction="true"/>

      It looks like the org.opennms.netmgt.xml.event.UpdateField is not serializable when the translator tries to clone the event

      Full log listing from when event arrives below

      2014-10-16 14:29:04,287 INFO  [event-translator-Thread] o.o.n.e.EventIpcManagerDefaultImpl: run: calling onEvent on event-translator for event uei.opennms.org/application/mobilelocation/single-working dbid 124593 with time Thursday, 16 October 2014 14:29:04 o'clock GMT
      2014-10-16 14:29:04,289 DEBUG [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: TransSpec.matches: No match comparing spec UEI: uei.opennms.org/application/mobilelocation/single-working with event UEI: uei.opennms.org/generic/traps/SNMP_Link_Down
      2014-10-16 14:29:04,289 DEBUG [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: TransSpec.matches: No match comparing spec UEI: uei.opennms.org/application/mobilelocation/single-working with event UEI: uei.opennms.org/generic/traps/SNMP_Link_Up
      2014-10-16 14:29:04,289 DEBUG [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: TransSpec.matches: No match comparing spec UEI: uei.opennms.org/application/mobilelocation/single-working with event UEI: uei.opennms.org/external/hyperic/alert
      2014-10-16 14:29:04,289 DEBUG [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: TransSpec.matches: No match comparing spec UEI: uei.opennms.org/application/mobilelocation/single-working with event UEI: uei.opennms.org/vendor/Cisco/traps/ciscoConfigManEvent
      2014-10-16 14:29:04,289 DEBUG [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: TransSpec.matches: No match comparing spec UEI: uei.opennms.org/application/mobilelocation/single-working with event UEI: uei.opennms.org/vendor/Juniper/traps/jnxCmCfgChange
      2014-10-16 14:29:04,289 DEBUG [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: TransSpec.matches: No match comparing spec UEI: uei.opennms.org/application/mobilelocation/single-working with event UEI: uei.opennms.org/application/mobilelocation
      2014-10-16 14:29:04,289 DEBUG [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: TransSpec.matches: checking mappings for spec.
      2014-10-16 14:29:04,293 DEBUG [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: TranslationMapping.assignmentsMatch: assignmentSpec: uei matches!
      2014-10-16 14:29:04,296 DEBUG [event-translator-Thread] o.o.n.t.EventTranslator: onEvent: received valid registered translation event: 
      
      2014-10-16 14:29:04,296 DEBUG [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: TranslationMapping.assignmentsMatch: assignmentSpec: uei matches!
      2014-10-16 14:29:04,303 ERROR [event-translator-Thread] o.o.n.c.EventTranslatorConfigFactory: Exception cloning event
      java.io.NotSerializableException: org.opennms.netmgt.xml.event.UpdateField
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) ~[?:1.7.0_55]
      	at java.util.ArrayList.writeObject(ArrayList.java:742) ~[?:1.7.0_55]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_55]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_55]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_55]
      	at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_55]
      	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:988) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1495) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) ~[?:1.7.0_55]
      	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) ~[?:1.7.0_55]
      	at org.opennms.netmgt.config.EventTranslatorConfigFactory.cloneEvent(EventTranslatorConfigFactory.java:876) [opennms-config-1.13.4.jar:?]
      	at org.opennms.netmgt.config.EventTranslatorConfigFactory$TranslationMapping.cloneEvent(EventTranslatorConfigFactory.java:431) [opennms-config-1.13.4.jar:?]
      	at org.opennms.netmgt.config.EventTranslatorConfigFactory$TranslationMapping.translate(EventTranslatorConfigFactory.java:421) [opennms-config-1.13.4.jar:?]
      	at org.opennms.netmgt.config.EventTranslatorConfigFactory$TranslationSpec.translate(EventTranslatorConfigFactory.java:353) [opennms-config-1.13.4.jar:?]
      	at org.opennms.netmgt.config.EventTranslatorConfigFactory.translateEvent(EventTranslatorConfigFactory.java:319) [opennms-config-1.13.4.jar:?]
      	at org.opennms.netmgt.translator.EventTranslator.onEvent(EventTranslator.java:166) [opennms-services-1.13.4.jar:?]
      	at org.opennms.netmgt.eventd.EventIpcManagerDefaultImpl$EventListenerExecutor$2.run(EventIpcManagerDefaultImpl.java:178) [opennms-services-1.13.4.jar:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_55]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_55]
      	at org.opennms.core.concurrent.LogPreservingThreadFactory$2.run(LogPreservingThreadFactory.java:106) [opennms-util-1.13.4.jar:?]
      	at java.lang.Thread.run(Thread.java:744) [?:1.7.0_55]
      2014-10-16 14:29:04,304 WARN  [event-translator-Thread] o.o.n.e.EventIpcManagerDefaultImpl: run: an unexpected error occured during ListenerThread event-translator
      java.lang.NullPointerException
      	at org.opennms.netmgt.config.EventTranslatorConfigFactory$TranslationMapping.cloneEvent(EventTranslatorConfigFactory.java:436) ~[opennms-config-1.13.4.jar:?]
      	at org.opennms.netmgt.config.EventTranslatorConfigFactory$TranslationMapping.translate(EventTranslatorConfigFactory.java:421) ~[opennms-config-1.13.4.jar:?]
      	at org.opennms.netmgt.config.EventTranslatorConfigFactory$TranslationSpec.translate(EventTranslatorConfigFactory.java:353) ~[opennms-config-1.13.4.jar:?]
      	at org.opennms.netmgt.config.EventTranslatorConfigFactory.translateEvent(EventTranslatorConfigFactory.java:319) ~[opennms-config-1.13.4.jar:?]
      	at org.opennms.netmgt.translator.EventTranslator.onEvent(EventTranslator.java:166) ~[opennms-services-1.13.4.jar:?]
      	at org.opennms.netmgt.eventd.EventIpcManagerDefaultImpl$EventListenerExecutor$2.run(EventIpcManagerDefaultImpl.java:178) [opennms-services-1.13.4.jar:?]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_55]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_55]
      	at org.opennms.core.concurrent.LogPreservingThreadFactory$2.run(LogPreservingThreadFactory.java:106) [opennms-util-1.13.4.jar:?]
      	at java.lang.Thread.run(Thread.java:744) [?:1.7.0_55]
      

        Attachments

          Activity

            People

            • Assignee:
              Murat Murat Yildiz
              Reporter:
              cgallen Craig Gallen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: