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

Mail Transport Monitor exception in 1.12.0

    Details

      Description

      After upgrading to OpenNMS 1.12.0, Mail Transport Monitor stopped working. Any services using that poller create an outage with the following:

      SMTP-Outbound-ServerName outage identified on interface 192.168.x.x with reason code: Exception from mailer: null.

      Here is the exception output in poller.log:

      2013-08-25 16:28:17,981 ERROR [LegacyScheduler-Thread-2-of-30] MailTransportMonitor: An error occurred while polling.
      java.lang.UnsupportedOperationException
      at java.util.Collections$UnmodifiableMap.put(Collections.java:1285)
      at org.opennms.core.utils.ParameterMap.getKeyedLong(ParameterMap.java:72)
      at org.opennms.core.utils.ParameterMap.getKeyedInteger(ParameterMap.java:93)
      at org.opennms.netmgt.poller.monitors.MailTransportParameters.getIntParm(MailTransportParameters.java:108)
      at org.opennms.netmgt.poller.monitors.MailTransportParameters.getRetries(MailTransportParameters.java:117)
      at org.opennms.netmgt.poller.monitors.MailTransportMonitor.sendTestMessage(MailTransportMonitor.java:412)
      at org.opennms.netmgt.poller.monitors.MailTransportMonitor.doMailTest(MailTransportMonitor.java:161)
      at org.opennms.netmgt.poller.monitors.MailTransportMonitor.poll(MailTransportMonitor.java:105)
      at org.opennms.netmgt.poller.pollables.LatencyStoringServiceMonitorAdaptor.poll(LatencyStoringServiceMonitorAdaptor.java:104)
      at org.opennms.netmgt.poller.pollables.PollableServiceConfig.poll(PollableServiceConfig.java:112)
      at org.opennms.netmgt.poller.pollables.PollableService.poll(PollableService.java:178)
      at org.opennms.netmgt.poller.pollables.PollableElement.poll(PollableElement.java:292)
      at org.opennms.netmgt.poller.pollables.PollableContainer$5.run(PollableContainer.java:305)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:263)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:249)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:227)
      at org.opennms.netmgt.poller.pollables.PollableContainer.poll(PollableContainer.java:312)
      at org.opennms.netmgt.poller.pollables.PollableInterface.poll(PollableInterface.java:205)
      at org.opennms.netmgt.poller.pollables.PollableContainer$5.run(PollableContainer.java:305)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:263)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:249)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:227)
      at org.opennms.netmgt.poller.pollables.PollableContainer.poll(PollableContainer.java:312)
      at org.opennms.netmgt.poller.pollables.PollableNode$3.run(PollableNode.java:303)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:263)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:249)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:227)
      at org.opennms.netmgt.poller.pollables.PollableNode.doPoll(PollableNode.java:306)
      at org.opennms.netmgt.poller.pollables.PollableElement.doPoll(PollableElement.java:183)
      at org.opennms.netmgt.poller.pollables.PollableService.doPoll(PollableService.java:211)
      at org.opennms.netmgt.poller.pollables.PollableService$PollRunner.run(PollableService.java:57)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:263)
      at org.opennms.netmgt.poller.pollables.PollableElement.withTreeLock(PollableElement.java:249)
      at org.opennms.netmgt.poller.pollables.PollableService.doRun(PollableService.java:383)
      at org.opennms.netmgt.poller.pollables.PollableService.run(PollableService.java:364)
      at org.opennms.netmgt.scheduler.Schedule.run(Schedule.java:135)
      at org.opennms.netmgt.scheduler.Schedule$ScheduleEntry.run(Schedule.java:80)
      at org.opennms.netmgt.scheduler.LegacyScheduler$1.run(LegacyScheduler.java:203)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at org.opennms.core.concurrent.LogPreservingThreadFactory$3.run(LogPreservingThreadFactory.java:107)
      at java.lang.Thread.run(Thread.java:662)

      I believe I have traced this to a change in MailTransportParameters.java. At some point Map<String,Object> getParameterMap() was updated; instead of returning m_parameterMap it returns Collections.unmodifiableMap(m_parameterMap).

      However, when retrieving values from the map (ParameterMap.getKeyedLong(...)), strings in the map are converted to long, causing the exception.

      I have reverted the change to MailTransportParameters.java and rebuilt on my system. This has resolved the issue, although I am not sure such a fix would be the preferred one for your project.

        Attachments

          Activity

            People

            • Assignee:
              agalue Alejandro Galue
              Reporter:
              bmcchesney Bob McChesney
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: