Description
Sujith Radhakrishnan opened SPR-8342 and commented
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...
Affects: 3.0.5
Issue Links:
- Test Spring 3.1 compatibility with Hibernate 3.6.x [SPR-8111] #12765 Test Spring 3.1 compatibility with Hibernate 3.6.x
2 votes, 3 watchers