org.hibernate.exception.SQLGrammarException: could not initialize a collection: [test.data.MyEntity.props#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

Solutions on the web

via Hibernate JIRA by Mattias Arbin, 1 year ago
could not initialize a collection: [test.data.MyEntity.props#1]
via Hibernate JIRA by Todd O, 1 year ago
could not initialize a collection: [test.data.MyEntity.props#1]
via Hibernate JIRA by Todd O, 1 year ago
could not initialize a collection: [test.data.MyEntity.props#1]
via Hibernate JIRA by Mattias Arbin, 1 year ago
could not initialize a collection: [test.data.MyEntity.props#1]
via Stack Overflow by user2436719
, 2 years ago
could not initialize a collection: [database.A.listB#1]
via Hibernate JIRA by Philipp Pirozhkov, 1 year ago
could not initialize a collection: [Storage.productQuantity#779317485]
org.hibernate.exception.SQLGrammarException: could not initialize a collection: [test.data.MyEntity.props#1]
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1876)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1098)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1192)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2051)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:137)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1676)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:223)
at org.hibernate.loader.Loader.loadCollection(Loader.java:1916)
at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:71)
at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1565)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
at org.hibernate.collection.AbstractPersistentCollection.readElementByIndex(AbstractPersistentCollection.java:161)
at org.hibernate.collection.PersistentMap.get(PersistentMap.java:127)
at test.TestKeyValue.test(TestKeyValue.java:43)
at test.TestKeyValue.main(TestKeyValue.java:57)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 2 years ago
Once, 6 months ago
5 times, 4 months ago
1741 times, 3 weeks ago
Samebug visitor profile picture
Unknown user
Once, 1 month ago
24 more bugmates

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