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

AssetRecordDao.findByNodeId is not working

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.11.3, 1.10.7
    • Fix Version/s: 1.10.8, 1.11.90
    • Component/s: Database
    • Security Level: Default (Default Security Scheme)
    • Labels:

      Description

      When trying to call findByNodeId from the AssetRecordDao (through AssetRecordDaoHibernate), the following exception is thrown:

      org.springframework.orm.hibernate3.HibernateQueryException: could not resolve property: nodeId of: org.opennms.netmgt.model.OnmsAssetRecord [from org.opennms.netmgt.model.OnmsAssetRecord rec where rec.nodeId = ?]; nested exception is org.hibernate.QueryException: could not resolve property: nodeId of: org.opennms.netmgt.model.OnmsAssetRecord [from org.opennms.netmgt.model.OnmsAssetRecord rec where rec.nodeId = ?]
      at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:660)
      at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
      at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
      at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
      at org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate.findUnique(AbstractDaoHibernate.java:256)
      at org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate.findUnique(AbstractDaoHibernate.java:230)
      at org.opennms.netmgt.dao.hibernate.AssetRecordDaoHibernate.findByNodeId(AssetRecordDaoHibernate.java:63)
      at org.opennms.netmgt.dao.AssetRecordDaoTest.testFindByNodeId(AssetRecordDaoTest.java:168)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
      at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
      at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
      at org.opennms.core.test.OpenNMSJUnit4ClassRunner.runChild(OpenNMSJUnit4ClassRunner.java:47)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
      at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      Caused by: org.hibernate.QueryException: could not resolve property: nodeId of: org.opennms.netmgt.model.OnmsAssetRecord [from org.opennms.netmgt.model.OnmsAssetRecord rec where rec.nodeId = ?]
      at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:67)
      at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:61)
      at org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:1385)
      at org.hibernate.hql.ast.tree.FromElementType.getPropertyType(FromElementType.java:302)
      at org.hibernate.hql.ast.tree.FromElement.getPropertyType(FromElement.java:407)
      at org.hibernate.hql.ast.tree.DotNode.getDataType(DotNode.java:589)
      at org.hibernate.hql.ast.tree.DotNode.prepareLhs(DotNode.java:264)
      at org.hibernate.hql.ast.tree.DotNode.resolve(DotNode.java:211)
      at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:117)
      at org.hibernate.hql.ast.tree.FromReferenceNode.resolve(FromReferenceNode.java:113)
      at org.hibernate.hql.ast.HqlSqlWalker.resolve(HqlSqlWalker.java:750)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1216)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4041)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3525)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1762)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:776)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:577)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281)
      at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229)
      at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:251)
      at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183)
      at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:134)
      at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
      at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
      at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
      at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
      at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
      at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1650)
      at sun.reflect.GeneratedMethodAccessor213.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.springframework.orm.hibernate3.HibernateTemplate$CloseSuppressingInvocationHandler.invoke(HibernateTemplate.java:1282)
      at $Proxy61.createQuery(Unknown Source)
      at org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate$3.doInHibernate(AbstractDaoHibernate.java:245)
      at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
      ... 33 more

        Attachments

          Activity

            People

            • Assignee:
              agalue Alejandro Galue
              Reporter:
              agalue Alejandro Galue
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: