I keep a text file for notes when I'm developing and many times something
frustrating is very simple to fix.  By default the lazyInitialization filter
is commented by default because it messes with one of the tests.  If you
pull sets of child objects e.g. on a JSP most likely you will get this error
when an action is called to pull the children.  Go to web.xml and you'll
find a filter to fix this there.  Uncomment the filter specific to Hibernate
or JPA.

My text file notes:

I Got this ...

[INFO] Starting scanner at interval of 3 seconds.
ERROR [btpool0-1] LazyInitializationException.<init>(19) | failed to lazily
initialize a collection of role: com.cpht.model.Item.itemDetails, no session
or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a
collection of role: com.cpht.model.Item.itemDetails, no session or session
was closed
    at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
    at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
    at
org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
    at org.hibernate.collection.PersistentBag.size(PersistentBag.java:225)
    at org.displaytag.tags.TableTag.initParameters(TableTag.java:1003)
    at org.displaytag.tags.TableTag.doStartTag(TableTag.java:722)
    at
org.apache.jsp.WEB_002dINF.pages.itemForm_jsp._jspService(org.apache.jsp.WEB_002dINF.pages.itemForm_jsp:201)


Did this ...

uncommented the lazy-initialization filter in web.xml

David

Reply via email to