struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Struts Newsgroup (@Basebeans.com) <str...@basebeans.com>
Subject Re: IOException while loading persisted sessions??
Date Fri, 05 Apr 2002 21:40:02 GMT
Subject: Re: IOException while loading persisted sessions??
From: "Jack Gao" <weigao@hotmail.com>
 ===
Well, I used to get same problem. And I think the problem is the Java Bean
you stored in session doesn't implement Serializable interface.

I did some test on Jakarta-Tomcat-4.0.3, looks like tomcat 4.x can save the
sessions even you shutdown it. Next time when you launch it, these sessions
still available. Actually, it's a pretty cool feature.

Tomcat 4.x implement this by Serializable interface, it assume that all the
object stored in a session implement Serializable interface. So when you
shutdown tomcat, it will write all object in the sessions to somewhere (_
directory under work directory I guess, but not sure.) by Serializable
interface. So if you store any object in session that doesn't implement this
interface, you will get this exception.

To me, even I implement it, sometime I still get this exception. And I found
that because I'm using log4j in my object. But Logger in log4j doesn't
implement Serializaable interface. So I suggest you don't you Logger in your
data storage bean.

Actually, as I see, even you got this exception, it will not effect your
application at all.

Hope this can help.

Jack

"David E" <d.edelstein@attbi.com> wrote in message
news:mailman.1017764101.11539.struts@basebeans.com...
Can someone please give me a clue why I keep getting the following
Exceptions in my jakarta-tomcat-4.0.1 log? The product class is not
serializable it is persisted in a database?? Is it something with the Struts
framework? I searched the archives, but couldn't find anything. Thanks in
advance!

2002-03-31 19:35:43 StandardHost[localhost]: Installing web application at
context path /regalos from URL file:C:\jakarta-tomcat-4.0.1\webapps\regalos
2002-03-31 19:35:43 WebappLoader[/regalos]: Deploying class repositories to
work directory C:\jakarta-tomcat-4.0.1\work\localhost\regalos
2002-03-31 19:35:43 WebappLoader[/regalos]: Deploy JAR
/WEB-INF/lib/struts.jar to
C:\jakarta-tomcat-4.0.1\webapps\regalos\WEB-INF\lib\struts.jar
2002-03-31 19:35:43 StandardManager[/regalos]: Seeding random number
generator class java.security.SecureRandom
2002-03-31 19:35:43 StandardManager[/regalos]: Seeding of random number
generator has been completed
2002-03-31 19:35:43 StandardManager[/regalos] IOException while loading
persisted sessions: java.io.WriteAbortedException: Writing aborted by
exception; java.io.NotSerializableException:
com.hp.mw.samples.struts.storefront.databeans.Product
java.io.WriteAbortedException: Writing aborted by exception;
java.io.NotSerializableException:
com.hp.mw.samples.struts.storefront.databeans.Product
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:440)
 at java.io.ObjectInputStream.inputArray(ObjectInputStream.java:1137)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
 at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
 at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
 at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
 at
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:
1268)
 at
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.j
ava:810)
 at
org.apache.catalina.session.StandardManager.load(StandardManager.java:411)
 at
org.apache.catalina.session.StandardManager.start(StandardManager.java:617)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1104)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3334)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
 at org.apache.catalina.core.StandardHost.install(StandardHost.java:712)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:599)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:777)
 at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:463)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:155)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:612)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
 at org.apache.catalina.core.StandardService.start(StandardService.java:388)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
 at java.lang.reflect.Method.invoke(Native Method)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

2002-03-31 19:35:43 StandardManager[/regalos] Exception loading sessions
from persistent storage
java.io.WriteAbortedException: Writing aborted by exception;
java.io.NotSerializableException:
com.hp.mw.samples.struts.storefront.databeans.Product
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:440)
 at java.io.ObjectInputStream.inputArray(ObjectInputStream.java:1137)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
 at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2258)
 at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:514)
 at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1407)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:381)
 at java.io.ObjectInputStream.readObject(ObjectInputStream.java:231)
 at
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:
1268)
 at
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.j
ava:810)
 at
org.apache.catalina.session.StandardManager.load(StandardManager.java:411)
 at
org.apache.catalina.session.StandardManager.start(StandardManager.java:617)

 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1104)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3334)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
 at org.apache.catalina.core.StandardHost.install(StandardHost.java:712)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:599)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:777)
 at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:463)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:155)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:612)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
 at org.apache.catalina.core.StandardService.start(StandardService.java:388)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
 at java.lang.reflect.Method.invoke(Native Method)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message