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

LazyInitializationException when querying the Measurements API

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • 17.0.0
    • REST
    • Security Level: Default (Default Security Scheme)

    Description

      When using the Measurements API backed by Newts, the following exception may occur:

      2015-09-23 11:28:24,372 WARN  [ForkJoinPool.commonPool-worker-2] o.o.n.d.s.DefaultResourceDao: Could not get resource for resource ID "nodeSource[NODES:ny-cassandra-1].interfaceSnmp[newts-cassandra21x]"
      org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.opennms.netmgt.model.OnmsNode.snmpInterfaces, no session or session was closed
              at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
              at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
              at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
              at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
              at org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:186) ~[hibernate-core-3.6.10.Final.jar:3.6.10.Final]
              at org.opennms.netmgt.dao.support.InterfaceSnmpResourceType.getNodeResources(InterfaceSnmpResourceType.java:169) ~[opennms-dao-17.0.0-SNAPSHOT.jar:?]
              at org.opennms.netmgt.dao.support.InterfaceSnmpResourceType.getChildByName(InterfaceSnmpResourceType.java:152) ~[opennms-dao-17.0.0-SNAPSHOT.jar:?]
              at org.opennms.netmgt.dao.support.DefaultResourceDao.getChildResource(DefaultResourceDao.java:426) ~[opennms-dao-17.0.0-SNAPSHOT.jar:?]
              at org.opennms.netmgt.dao.support.DefaultResourceDao.getResourceById(DefaultResourceDao.java:343) ~[opennms-dao-17.0.0-SNAPSHOT.jar:?]
              at org.opennms.netmgt.measurements.impl.NewtsFetchStrategy.lambda$fetch$0(NewtsFetchStrategy.java:114) ~[org.opennms.features.newts-17.0.0-SNAPSHOT.jar:?]
      

      This happens intermittently when a request contains multiple resources.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: