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

LazyInitializationException when using ticketing and alarm history in Elastic

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 24.0.0
    • Fix Version/s: 24.0.0
    • Component/s: None
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon - April 3rd 2019

      Description

      We encountered the following exception on an install using the alarm ticketing integration & the Elastic alarm history integration:

      [09:32:39]  2019-03-01 09:15:47,275 ERROR [Timer-1] o.o.n.a.AlarmLifecycleListenerManager: Error occurred while invoking listener: org.opennms.features.alarms.history.elastic.ElasticAlarmIndexer@314dd823. Skipping.
      
      [09:32:39]  org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.opennms.netmgt.model.OnmsAlarm.details, no session or session was closed
      
      [09:32:39]          at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
      
      [09:32:39]          at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
      
      [09:32:39]          at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:122) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
      
      [09:32:39]          at org.hibernate.collection.PersistentMap.size(PersistentMap.java:137) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
      
      [09:32:39]          at java.util.HashMap.putMapEntries(HashMap.java:501) ~[?:1.8.0_202]
      
      [09:32:39]          at java.util.HashMap.<init>(HashMap.java:490) ~[?:1.8.0_202]
      
      [09:32:39]          at org.opennms.features.alarms.history.elastic.mapping.AlarmMapperImpl.map(AlarmMapperImpl.java:70) ~[?:?]
      
      [09:32:39]          at org.opennms.features.alarms.history.elastic.mapping.MapStructDocumentImpl.apply(MapStructDocumentImpl.java:60) ~[?:?]
      
      [09:32:39]          at org.opennms.features.alarms.history.elastic.mapping.MapStructDocumentImpl.apply(MapStructDocumentImpl.java:46) ~[?:?]
      
      [09:32:39]          at org.opennms.features.alarms.history.elastic.ElasticAlarmIndexer.getDocumentIfNeedsIndexing(ElasticAlarmIndexer.java:465) ~[?:?]
      
      [09:32:39]          at org.opennms.features.alarms.history.elastic.ElasticAlarmIndexer.handleNewOrUpdatedAlarm(ElasticAlarmIndexer.java:383) ~[?:?]
      
      [09:32:39]          at org.opennms.netmgt.alarmd.AlarmLifecycleListenerManager.lambda$onNewOrUpdatedAlarm$0(AlarmLifecycleListenerManager.java:138) ~[opennms-alarmd-25.0.0-SNAPSHOT.jar:?]
      
      [09:32:39]          at org.opennms.netmgt.alarmd.AlarmLifecycleListenerManager.forEachListener(AlarmLifecycleListenerManager.java:209) ~[opennms-alarmd-25.0.0-SNAPSHOT.jar:?]
      
      [09:32:40]          at org.opennms.netmgt.alarmd.AlarmLifecycleListenerManager.onNewOrUpdatedAlarm(AlarmLifecycleListenerManager.java:138) ~[opennms-alarmd-25.0.0-SNAPSHOT.jar:?]
      
      [09:32:40]          at org.opennms.netmgt.alarmd.AlarmLifecycleListenerManager.onLastAutomationTimeUpdated(AlarmLifecycleListenerManager.java:198) ~[opennms-alarmd-25.0.0-SNAPSHOT.jar:?]
      
      [09:32:40]          at org.opennms.netmgt.dao.support.AlarmEntityNotifierImpl.lambda$didUpdateLastAutomationTime$11(AlarmEntityNotifierImpl.java:110) ~[opennms-dao-25.0.0-SNAPSHOT.jar:?]
      
      [09:32:40]          at org.opennms.netmgt.dao.support.AlarmEntityNotifierImpl.forEachListener(AlarmEntityNotifierImpl.java:121) [opennms-dao-25.0.0-SNAPSHOT.jar:?]
      
      [09:32:40]          at org.opennms.netmgt.dao.support.AlarmEntityNotifierImpl.didUpdateLastAutomationTime(AlarmEntityNotifierImpl.java:110) [opennms-dao-25.0.0-SNAPSHOT.jar:?]
      
      [09:32:40]          at org.opennms.netmgt.alarmd.drools.DefaultAlarmTicketerService.updateLastAutomationTime(DefaultAlarmTicketerService.java:129) [opennms-alarmd-25.0.0-SNAPSHOT.jar:?]
      
      [09:32:40]          at org.opennms.netmgt.alarmd.drools.DefaultAlarmTicketerService.updateTicket(DefaultAlarmTicketerService.java:98) [opennms-alarmd-25.0.0-SNAPSHOT.jar:?]
      
      [09:32:40]          at org.opennms.netmgt.alarmd.drools.Rule_updateTickets965021008.defaultConsequence(Rule_updateTickets965021008.java:8) [drools-core-7.7.0.Final.jar:?]
      
      [09:32:40]          at org.opennms.netmgt.alarmd.drools.Rule_updateTickets965021008DefaultConsequenceInvokerGenerated.evaluate(Unknown Source) [?:?]
      
      [09:32:40]          at org.opennms.netmgt.alarmd.drools.Rule_updateTickets965021008DefaultConsequenceInvoker.evaluate(Unknown Source) [drools-core-7.7.0.Final.jar:?]
      
      [09:32:40]          at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:431) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.phreak.RuleExecutor.fireActivation(RuleExecutor.java:379) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:135) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:88) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:34) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1067) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.common.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:1014) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1006) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1308) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1299) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1283) [drools-core-7.7.0.Final.jar:7.7.0.Final]
      
      [09:32:40]          at org.opennms.netmgt.alarmd.drools.ManagedDroolsContext$1.run(ManagedDroolsContext.java:161) [opennms-alarmd-25.0.0-SNAPSHOT.jar:?]
      
      [09:32:40]          at java.util.TimerThread.mainLoop(Timer.java:555) [?:1.8.0_202]
      
      [09:32:40]          at java.util.TimerThread.run(Timer.java:505) [?:1.8.0_202]
      

        Attachments

          Activity

            People

            • Assignee:
              j-white Jesse White
              Reporter:
              j-white Jesse White
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: