From: <leg...@at...> - 2003-12-18 01:39:08
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-567 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-567 Summary: NullPointerException when using "select new" on constructor with native types Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1.1 Assignee: Reporter: Shorn Tolley Created: Wed, 17 Dec 2003 7:38 PM Updated: Wed, 17 Dec 2003 7:38 PM Environment: Win2k, JDK 1.4.2, HB 2.1.1 Description: 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 --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |