nrm.clas.persistence.PersistenceLayerException: Error finding documents by case

Hibernate JIRA | Shorn Tolley | 1 decade ago
  1. 0

    When my DTO object that I am "Select new"'ing into has a constructor that takes native types, I get the error attached. If my DTO has a ctor which takes wrapper types, the code works. If it has both, then Hibernate seems to prefer the native version, and I get the error. I tried implementing the native-type ctor in two ways, using the "this" keyword to delegate to the wrapper-type ctor or with direct calls to the setter methods on the DTO. Didn't seem to make any difference. Exception: [junit] Testcase: testFindDocumentsByCaseDTOsWithEmptyCriteria(nrm.clas.persistence.document.test.DocumentPersistenceManagerTest): Caused an ERROR [junit] Error finding documents by case [junit] nrm.clas.persistence.PersistenceLayerException: Error finding documents by case [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [junit] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [junit] at java.lang.reflect.Constructor.newInstance(Constructor.java:274) [junit] at nrm.clas.ExceptionUtil.instantiateException(ExceptionUtil.java:89) [junit] at nrm.clas.ExceptionUtil.createNestedException(ExceptionUtil.java:127) [junit] at nrm.clas.ExceptionUtil.createPersistenceLayerException(ExceptionUtil.java:312) [junit] at nrm.clas.ExceptionUtil.createPersistenceLayerException(ExceptionUtil.java:291) [junit] at nrm.clas.persistence.document.DocumentPersistenceManagerImpl.findDocumentsByCaseDTOs(DocumentPersistenceManagerImpl.java:162) [junit] at nrm.clas.persistence.document.test.DocumentPersistenceManagerTest.testFindDocumentsByCaseDTOsWithEmptyCriteria(DocumentPersistenceManagerTest.java:45) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [junit] at nrm.clas.test.ClasTestCase.run(ClasTestCase.java:508) [junit] Caused by: nrm.clas.common.persistence.PersistenceException: find [junit] at nrm.clas.persistence.BasePersistenceManagerImpl.handleError(BasePersistenceManagerImpl.java:97) [junit] at nrm.clas.persistence.BasePersistenceManagerImpl.handleError(BasePersistenceManagerImpl.java:116) [junit] at nrm.clas.persistence.BasePersistenceManagerImpl.find(BasePersistenceManagerImpl.java:365) [junit] at nrm.clas.persistence.document.DocumentPersistenceManagerImpl.findDocumentsByCaseDTOs(DocumentPersistenceManagerImpl.java:159) [junit] ... 16 more [junit] Caused by: net.sf.hibernate.QueryException: could not instantiate: class nrm.clas.dto.document.CaseDocumentDTO [junit] at net.sf.hibernate.hql.QueryTranslator.getResultColumnOrRow(QueryTranslator.java:993) [junit] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:221) [junit] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132) [junit] at net.sf.hibernate.loader.Loader.doList(Loader.java:949) [junit] at net.sf.hibernate.loader.Loader.list(Loader.java:940) [junit] at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:833) [junit] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1475) [junit] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1454) [junit] at nrm.clas.persistence.BasePersistenceManagerImpl.find(BasePersistenceManagerImpl.java:359) [junit] ... 17 more [junit] Caused by: java.lang.NullPointerException [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [junit] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [junit] at java.lang.reflect.Constructor.newInstance(Constructor.java:274) [junit] at net.sf.hibernate.hql.QueryTranslator.getResultColumnOrRow(QueryTranslator.java:990) [junit] ... 25 more

    Hibernate JIRA | 1 decade ago | Shorn Tolley
    nrm.clas.persistence.PersistenceLayerException: Error finding documents by case
  2. 0

    When my DTO object that I am "Select new"'ing into has a constructor that takes native types, I get the error attached. If my DTO has a ctor which takes wrapper types, the code works. If it has both, then Hibernate seems to prefer the native version, and I get the error. I tried implementing the native-type ctor in two ways, using the "this" keyword to delegate to the wrapper-type ctor or with direct calls to the setter methods on the DTO. Didn't seem to make any difference. Exception: [junit] Testcase: testFindDocumentsByCaseDTOsWithEmptyCriteria(nrm.clas.persistence.document.test.DocumentPersistenceManagerTest): Caused an ERROR [junit] Error finding documents by case [junit] nrm.clas.persistence.PersistenceLayerException: Error finding documents by case [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [junit] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [junit] at java.lang.reflect.Constructor.newInstance(Constructor.java:274) [junit] at nrm.clas.ExceptionUtil.instantiateException(ExceptionUtil.java:89) [junit] at nrm.clas.ExceptionUtil.createNestedException(ExceptionUtil.java:127) [junit] at nrm.clas.ExceptionUtil.createPersistenceLayerException(ExceptionUtil.java:312) [junit] at nrm.clas.ExceptionUtil.createPersistenceLayerException(ExceptionUtil.java:291) [junit] at nrm.clas.persistence.document.DocumentPersistenceManagerImpl.findDocumentsByCaseDTOs(DocumentPersistenceManagerImpl.java:162) [junit] at nrm.clas.persistence.document.test.DocumentPersistenceManagerTest.testFindDocumentsByCaseDTOsWithEmptyCriteria(DocumentPersistenceManagerTest.java:45) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [junit] at nrm.clas.test.ClasTestCase.run(ClasTestCase.java:508) [junit] Caused by: nrm.clas.common.persistence.PersistenceException: find [junit] at nrm.clas.persistence.BasePersistenceManagerImpl.handleError(BasePersistenceManagerImpl.java:97) [junit] at nrm.clas.persistence.BasePersistenceManagerImpl.handleError(BasePersistenceManagerImpl.java:116) [junit] at nrm.clas.persistence.BasePersistenceManagerImpl.find(BasePersistenceManagerImpl.java:365) [junit] at nrm.clas.persistence.document.DocumentPersistenceManagerImpl.findDocumentsByCaseDTOs(DocumentPersistenceManagerImpl.java:159) [junit] ... 16 more [junit] Caused by: net.sf.hibernate.QueryException: could not instantiate: class nrm.clas.dto.document.CaseDocumentDTO [junit] at net.sf.hibernate.hql.QueryTranslator.getResultColumnOrRow(QueryTranslator.java:993) [junit] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:221) [junit] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132) [junit] at net.sf.hibernate.loader.Loader.doList(Loader.java:949) [junit] at net.sf.hibernate.loader.Loader.list(Loader.java:940) [junit] at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:833) [junit] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1475) [junit] at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1454) [junit] at nrm.clas.persistence.BasePersistenceManagerImpl.find(BasePersistenceManagerImpl.java:359) [junit] ... 17 more [junit] Caused by: java.lang.NullPointerException [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [junit] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [junit] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [junit] at java.lang.reflect.Constructor.newInstance(Constructor.java:274) [junit] at net.sf.hibernate.hql.QueryTranslator.getResultColumnOrRow(QueryTranslator.java:990) [junit] ... 25 more

    Hibernate JIRA | 1 decade ago | Shorn Tolley
    nrm.clas.persistence.PersistenceLayerException: Error finding documents by case
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Add Support for Lein 2

    GitHub | 4 years ago | espeed
    java.lang.NullPointerException
  5. 0

    Error recording HTTP exchange

    GitHub | 3 years ago | dkowis
    java.lang.NullPointerException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0()
    2. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      4 frames
    3. net.sf.hibernate
      SessionImpl.find
      1. net.sf.hibernate.hql.QueryTranslator.getResultColumnOrRow(QueryTranslator.java:990)
      2. net.sf.hibernate.loader.Loader.doQuery(Loader.java:221)
      3. net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
      4. net.sf.hibernate.loader.Loader.doList(Loader.java:949)
      5. net.sf.hibernate.loader.Loader.list(Loader.java:940)
      6. net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:833)
      7. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1475)
      8. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1454)
      8 frames
    4. nrm.clas.persistence
      DocumentPersistenceManagerImpl.findDocumentsByCaseDTOs
      1. nrm.clas.persistence.BasePersistenceManagerImpl.find(BasePersistenceManagerImpl.java:359)
      2. nrm.clas.persistence.BasePersistenceManagerImpl.handleError(BasePersistenceManagerImpl.java:116)
      3. nrm.clas.persistence.BasePersistenceManagerImpl.find(BasePersistenceManagerImpl.java:365)
      4. nrm.clas.persistence.document.DocumentPersistenceManagerImpl.findDocumentsByCaseDTOs(DocumentPersistenceManagerImpl.java:159)
      4 frames
    5. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:274)
      4 frames
    6. nrm.clas
      ExceptionUtil.createPersistenceLayerException
      1. nrm.clas.ExceptionUtil.instantiateException(ExceptionUtil.java:89)
      2. nrm.clas.ExceptionUtil.createNestedException(ExceptionUtil.java:127)
      3. nrm.clas.ExceptionUtil.createPersistenceLayerException(ExceptionUtil.java:312)
      4. nrm.clas.ExceptionUtil.createPersistenceLayerException(ExceptionUtil.java:291)
      4 frames
    7. nrm.clas.persistence
      DocumentPersistenceManagerTest.testFindDocumentsByCaseDTOsWithEmptyCriteria
      1. nrm.clas.persistence.document.DocumentPersistenceManagerImpl.findDocumentsByCaseDTOs(DocumentPersistenceManagerImpl.java:162)
      2. nrm.clas.persistence.document.test.DocumentPersistenceManagerTest.testFindDocumentsByCaseDTOsWithEmptyCriteria(DocumentPersistenceManagerTest.java:45)
      2 frames
    8. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    9. nrm.clas.test
      ClasTestCase.run
      1. nrm.clas.test.ClasTestCase.run(ClasTestCase.java:508)
      1 frame