org.springframework.dao.InvalidDataAccessResourceUsageException: could not initialize a collection: [com.inventory.inventory.vo.Person.listAddress#1]; nested exception is org.hibernate.exception.SQLGrammarException: could not initialize a collection: [com.inventory.inventory.vo.Person.listAddress#1]

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

Try downgrading PostgresSQL server to 9.5 or update your PostgresSQL driver to 9.4-1211 with the following command: <postgresql.version>9.4.1211</postgresql.version>

Solutions on the web

via Stack Overflow by A1ucard
, 1 year ago
could not initialize a collection: [com.inventory.inventory.vo.Person.listAddress#1]; nested exception is org.hibernate.exception.SQLGrammarException: could not initialize a collection: [com.inventory.inventory.vo.Person.listAddress#1]
via Stack Overflow by Thiagarajan Hariharan
, 2 years ago
, wifinetwor0_.pairwise_cipher as pairwise7_0_, wifinetwor0_.protocol as protocol0_, wifinetwor0_.vpn_type as vpn9_0_, wifinetwor0_.vpn_url as vpn10_0_, wifinetwor0_.authAlgorithm as authAlg11_0_ from wifi_network_config wifinetwor0_]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
via spring.io by Unknown author, 2 years ago
could not insert: [com.acs.gs.juror.model.accounting.Adjustment]; nested exception is org.hibernate.exception.SQLGrammarException: could not insert: [com.acs.gs.juror.model.accounting.Adjustment]
via hsqldb by dma_k
, 1 year ago
could not execute query; SQL [select count(*) from document where current_date - cast(image_indexing_date as date) >= 20]; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
via Stack Overflow by arsh
, 1 year ago
could not insert: [com.RML.Model.MailBean]; nested exception is org.hibernate.exception.SQLGrammarException: could not insert: [com.RML.Model.MailBean]
via Stack Overflow by SM ANSARI
, 1 year ago
could not insert: [in.co.ebms.iapp.model.Candidate]; SQL [insert into Candidate (age, name) values (?, ?)]; nested exception is org.hibernate.exception.SQLGrammarException: could not insert: [in.co.ebms.iapp.model.Candidate]
org.springframework.dao.InvalidDataAccessResourceUsageException: could not initialize a collection: [com.inventory.inventory.vo.Person.listAddress#1]; nested exception is org.hibernate.exception.SQLGrammarException: could not initialize a collection: [com.inventory.inventory.vo.Person.listAddress#1]
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1849)
at org.hibernate.loader.Loader.doQuery(Loader.java:718)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270)
at org.hibernate.loader.Loader.loadCollection(Loader.java:2062)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1853)
at org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:899)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:275)
at org.hibernate.loader.Loader.doList(Loader.java:2294)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2172)
at org.hibernate.loader.Loader.list(Loader.java:2167)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1258)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:930)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at com.inventory.inventory.dao.impl.ProductsDAOImpl.getProductsByCode(ProductsDAOImpl.java:28)
at undefined.Main.main(Main.java:14)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
10 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
104 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.