ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khanna, Vijay \(GE, Corporate, consultant\)" <vijay.kha...@ge.com>
Subject RE: java.io.NotSerializableException: com.ibatis.db.sqlmap.LazyLoadList
Date Wed, 23 Aug 2006 17:54:39 GMT
 
LazyLoadList is not Serializable. I made it Serializable but the problem
still remains. I spoke to Jboss guys to know if theres any issue with
the Jboss cache, and think its fine on that side. 

Jboss gave us a utility class as a Listener to find the actual object in
the list causing this concern when stored in the HttpSession. To my
surprise it found one bean/DTO type which is not serializable. I quickly
checked the bean and found that it does implment Serializable interface
and all the declaration within the bean (primitives and Lists) are valid
serializable entities.

I did convert a specific part of the application to be 2.x compatible
and ran it. I found that this problem does not surface with 2.x. I guess
this has been taken care off.

There are nearly 30+ applications running on Ibatis 1.x and migrating
them to 2.x is really not easy from effort and business point of view. 

So maybe if I find a workaround to solve this issue so that cache &
session replication works in a cluster, will helps us a lot..

Thanks,
Vijay

-----Original Message-----
From: Ben Munat [mailto:bent@munat.com] 
Sent: Wednesday, August 23, 2006 1:32 PM
To: user-java@ibatis.apache.org
Subject: Re: java.io.NotSerializableException:
com.ibatis.db.sqlmap.LazyLoadList

I think the problem is in the underlying jdk classes used by
LazyLoadList... seems like someone here told me that before.

b

Chris Lamey wrote:
> Looks to me like com.ibatis.db.sqlmap.LazyLoadList isn't Serializable,

> so you can't use it in your distributed cache.  If you have the 1.x 
> iBATIS source around, you could verify that.
> 
> I'm not sure why you're thinking java.lang.Object is the culprit...the

> method java.util.ArrayList.writeObject is overloaded for 
> serialization, it doesn't mean it's trying to write out
java.lang.Object.
> 
> I do know 1.x isn't supported anymore and so you're likely to have 
> trouble getting help.
> 
> However, I don't know 1.x at all...is there a way to turn lazy loading

> off?
> 
> On Wed, 2006-08-23 at 13:10 -0400, Khanna, Vijay (GE, Corporate,
> consultant) wrote:
>> Hi,
>>  
>> Any help on this issue please ?
>>  
>> Thanks,
>> Vijay
>>
>>
>> _____________________________________________________________________
>> _
>> From: Khanna, Vijay (GE, Corporate, consultant)
>> Sent: Wednesday, August 23, 2006 10:22 AM
>> To: user-java@ibatis.apache.org
>> Subject: java.io.NotSerializableException:
>> com.ibatis.db.sqlmap.LazyLoadList
>>
>>
>>
>> Hello,
>>  
>> We are using Ibatis 1.x along with JBoss cache. Now when the 
>> application is run in clustered environment and the Cache & session 
>> replication happens, we are getting an error from Ibatis.
>> "java.io.NotSerializableException:
>> com.ibatis.db.sqlmap.LazyLoadList" . I checked within the application

>> code to find if we are using any instance of java.lang.Object, but 
>> could not find any...
>>  
>> From the stacktrace below, it seems that and instance of 
>> 'java.lang.Object' is present in the list and thats where the problem

>> is...
>>  
>> I checked Ibatis 2.x and noticed this problem does not occur. But due

>> to some reasons, we do not wish to move to 2.x but would like a 
>> solution for this. Help from the Ibatis's Gurus appreciated !
>>  
>> Heres the detailed stack..
>>  
>> 10:14:16,764 INFO [STDOUT] java.io.NotSerializableException:
>> com.ibatis.db.sqlmap.LazyLoadList
>>
>> 10:14:16,764 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
>>
>> 10:14:16,764 INFO [STDOUT] at
>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
>> :1332)
>>
>> 10:14:16,764 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13
>> 04)
>>
>> 10:14:16,764 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
>> a:1247)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java
>> :1332)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:13
>> 04)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
>> a:1247)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.util.ArrayList.writeObject(ArrayList.java:529)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> sun.reflect.GeneratedMethodAccessor226.invoke(Unknown Source)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.lang.reflect.Method.invoke(Method.java:324)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:80
>> 9)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:12
>> 96)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
>> a:1247)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.util.HashMap.writeObject(HashMap.java:978)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> sun.reflect.GeneratedMethodAccessor225.invoke(Unknown Source)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.lang.reflect.Method.invoke(Method.java:324)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:80
>> 9)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:12
>> 96)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.jav
>> a:1247)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.jboss.web.tomcat.tc5.session.SessionBasedClusteredSession.writeEx
>> ternal(SessionBasedClusteredSession.java:288)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.jboss.web.tomcat.tc5.session.JBossCacheService.externalizeSession
>> (JBossCacheService.java:771)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.jboss.web.tomcat.tc5.session.JBossCacheService.putSession(JBossCa
>> cheService.java:229)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.jboss.web.tomcat.tc5.session.SessionBasedClusteredSession.process
>> SessionRepl(SessionBasedClusteredSession.java:165)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.jboss.web.tomcat.tc5.session.JBossCacheManager.processSessionRepl
>> (JBossCacheManager.java:606)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.jboss.web.tomcat.tc5.session.JBossCacheManager.storeSession(JBoss
>> CacheManager.java:375)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.jboss.web.tomcat.tc5.session.InstantSnapshotManager.snapshot(Inst
>> antSnapshotManager.java:38)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.jboss.web.tomcat.tc5.session.ClusteredSessionValve.invoke(Cluster
>> edSessionValve.java:91)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
>> e.java:59)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
>> ava:126)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
>> ava:105)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
>> ve.java:107)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
>> a:148)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
>> :856)
>>
>> 10:14:16,780 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol
>> $Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
>> int.java:527)
>>
>> 10:14:16,780 INFO [STDOUT] at
>> org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
>> kerThread.java:112)
>>
>> 10:14:16,780 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
>>
>>
>>  
>> Thanks,
>> Vijay
>>  

Mime
View raw message