You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lazy initialization error with LOG4J turned on - failed to lazily initialize a collection of role: ...no session or session was closed [SPR-8342] #12990
in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently apply
With log4J set to DEBUG ALL, I get the following error when a client access the server via amf remote-messaging.
INFO: [ERROR,LazyInitializationException] failed to lazily initialize a collection of role: ...., no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.switchpt.tbm.entity.Projects.tbmJobDescs, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:383)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:375)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:122)
at org.hibernate.collection.PersistentSet.size(PersistentSet.java:162)
at org.springframework.core.style.DefaultValueStyler.style(DefaultValueStyler.java:104)
at org.springframework.core.style.DefaultValueStyler.style(DefaultValueStyler.java:72)
It works fine if i disable the log.
Looks like the issue is caused by line# 159 in GenericConversionService.java:
156 public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
157 assertNotNull(sourceType, targetType);
158 if (logger.isDebugEnabled()) {
159 logger.debug("Converting value " + StylerUtils.style(source) + " of " + sourceType + " to " + targetType);
160 }
161 if (sourceType == TypeDescriptor.NULL) {
The log is trying to deserialize the data causing the issue...
This is likely rarely enough encountered that it may not be worth explicitly addressing, but I have moved it here (from Spring BlazeDS) since the source of the problem is GenericConversionService, and in particular, its use of StylerUtils.style, which forces initialization of lazy Hibernate proxies due to its attempt at deep traversal.
in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently apply
Activity
spring-projects-issues commentedon May 17, 2011
Jeremy Grelle commented
This is likely rarely enough encountered that it may not be worth explicitly addressing, but I have moved it here (from Spring BlazeDS) since the source of the problem is GenericConversionService, and in particular, its use of StylerUtils.style, which forces initialization of lazy Hibernate proxies due to its attempt at deep traversal.
spring-projects-issues commentedon Sep 22, 2015
Juergen Hoeller commented
Closing groups of outdated issues. Please reopen if still relevant.