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

Elasticsearch event forwarding gets Hibernate lazy init exception

    XMLWordPrintable

    Details

      Description

      I'm seeing a high failure rate on the Elasticsearch event forwarder (around 65%) and it looks like it's due to this exception inside karaf.log. Since it's a Hibernate exception during logging, I'm somewhat confused why the failure rate isn't 100%...

      2016-12-06 15:35:58,337 WARN  org.apache.camel.camel-core:2.14.1(130) [Camel (elasticsearchEventForwarder) thread #41 - seda://ES] org.apache.camel.component.seda.SedaConsumer: Error processing exchange. Exchange[Message: [Body is null]]. Caused by: [org.apache.camel.language.bean.RuntimeBeanExpressionException - Failed to invoke method: .toString() on null due to: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: toString() on null due to: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.opennms.netmgt.model.OnmsMonitoringSystem.properties, no session or session was closed]
      org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: .toString() on null due to: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: toString() on null due to: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.opennms.netmgt.model.OnmsMonitoringSystem.properties, no session or session was closed
      	at org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:117)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:132)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.model.language.ExpressionDefinition.evaluate(ExpressionDefinition.java:121)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.model.language.ExpressionDefinition.evaluate(ExpressionDefinition.java:113)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.builder.ExpressionBuilder$33.evaluate(ExpressionBuilder.java:822)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.builder.ExpressionBuilder$60.evaluate(ExpressionBuilder.java:1432)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.processor.LogProcessor.process(LogProcessor.java:51)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.builder.NoErrorHandlerBuilder$1.process(NoErrorHandlerBuilder.java:40)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:200)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:147)[130:org.apache.camel.camel-core:2.14.1]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_111]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_111]
      	at java.lang.Thread.run(Thread.java:745)[:1.8.0_111]
      Caused by: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: toString() on null due to: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.opennms.netmgt.model.OnmsMonitoringSystem.properties, no session or session was closed
      	at org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.process(BeanExpression.java:285)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:114)[130:org.apache.camel.camel-core:2.14.1]
      	... 21 more
      Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.opennms.netmgt.model.OnmsMonitoringSystem.properties, no session or session was closed
      	at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
      	at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
      	at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:368)
      	at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
      	at org.hibernate.collection.PersistentMap.toString(PersistentMap.java:274)
      	at java.lang.String.valueOf(String.java:2994)[:1.8.0_111]
      	at java.lang.StringBuilder.append(StringBuilder.java:131)[:1.8.0_111]
      	at org.opennms.netmgt.model.minion.OnmsMinion.toString(OnmsMinion.java:74)
      	at java.lang.String.valueOf(String.java:2994)[:1.8.0_111]
      	at java.lang.StringBuilder.append(StringBuilder.java:131)[:1.8.0_111]
      	at java.util.AbstractMap.toString(AbstractMap.java:559)[:1.8.0_111]
      	at sun.reflect.GeneratedMethodAccessor606.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_111]
      	at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_111]
      	at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:408)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:279)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:252)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:167)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:67)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.language.bean.BeanExpression$InvokeProcessor.process(BeanExpression.java:189)[130:org.apache.camel.camel-core:2.14.1]
      	at org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.process(BeanExpression.java:281)[130:org.apache.camel.camel-core:2.14.1]
      	... 22 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                seth Seth Leger
                Reporter:
                seth Seth Leger
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: