You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matt Raible <ma...@yahoo.com> on 2001/08/28 20:30:41 UTC

java.io.NotSerializableException: java.util.HashMap

I am getting the following error on a JSP page that I am using struts taglibs. 
However, I am using Sets and ArrayLists for my <selects> - not a hashmap??

Any ideas?

Thanks,

Matt

[28/Aug/2001 12:29:20:9] error: Exception: SERVLET-IO_exception: IOException
occurred
Exception Stack Trace:
java.io.NotSerializableException: java.util.HashMap$1
        at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:845)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
        at
java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1567)
        at
java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:453)
        at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:911)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
        at
com.netscape.server.servlet.platformhttp.PlatformNASSession.putMemberValue(Unknown
Source)
        at
com.netscape.server.servlet.platformhttp.PlatformNASSession.saveSession(Unknown
Source)
        at
com.netscape.server.servlet.platformhttp.PlatformHttpServletRequest.saveSession(Unknown
Source)
        at
com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown Source)
        at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
        at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
        at com.kivasoft.thread.ThreadBasic.run(Native Method)
        at java.lang.Thread.run(Thread.java:479)

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Re: java.io.NotSerializableException: java.util.HashMap

Posted by Matt Raible <ma...@yahoo.com>.
I figured it out - I was stuffing hashmaps and rowsets into my ActionForms, and
then storing those in the session.  Because of the clustering configuration we
have in iPlanet, this error was being thrown for the reasons you state.

I fixed this my moving any non-serializable components into beans only kept in
the request.

Thanks,

Matt

--- martin.cooper@tumbleweed.com wrote:
> I don't know what the relationship is between this error and your JSP, but
> it looks like your container is trying to serialize the session for some
> reason. Apparently you have a session attribute which is a HashMap, and it
> doesn't like that because it can't serialize it.
> 
> --
> Martin Cooper
> 
> 
> ----- Original Message -----
> From: "Matt Raible" <ma...@yahoo.com>
> To: <st...@jakarta.apache.org>
> Sent: Tuesday, August 28, 2001 11:30 AM
> Subject: java.io.NotSerializableException: java.util.HashMap
> 
> 
> > I am getting the following error on a JSP page that I am using struts
> taglibs.
> > However, I am using Sets and ArrayLists for my <selects> - not a hashmap??
> >
> > Any ideas?
> >
> > Thanks,
> >
> > Matt
> >
> > [28/Aug/2001 12:29:20:9] error: Exception: SERVLET-IO_exception:
> IOException
> > occurred
> > Exception Stack Trace:
> > java.io.NotSerializableException: java.util.HashMap$1
> >         at
> java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:845)
> >         at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
> >         at
> > java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1567)
> >         at
> > java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:453)
> >         at
> java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:911)
> >         at
> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
> >         at
> >
> com.netscape.server.servlet.platformhttp.PlatformNASSession.putMemberValue(U
> nknown
> > Source)
> >         at
> >
> com.netscape.server.servlet.platformhttp.PlatformNASSession.saveSession(Unkn
> own
> > Source)
> >         at
> >
> com.netscape.server.servlet.platformhttp.PlatformHttpServletRequest.saveSess
> ion(Unknown
> > Source)
> >         at
> > com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
> Source)
> >         at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
> >         at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
> >         at com.kivasoft.thread.ThreadBasic.run(Native Method)
> >         at java.lang.Thread.run(Thread.java:479)
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Make international calls for as low as $.04/minute with Yahoo! Messenger
> > http://phonecard.yahoo.com/
> 
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Re: java.io.NotSerializableException: java.util.HashMap

Posted by ma...@tumbleweed.com.
I don't know what the relationship is between this error and your JSP, but
it looks like your container is trying to serialize the session for some
reason. Apparently you have a session attribute which is a HashMap, and it
doesn't like that because it can't serialize it.

--
Martin Cooper


----- Original Message -----
From: "Matt Raible" <ma...@yahoo.com>
To: <st...@jakarta.apache.org>
Sent: Tuesday, August 28, 2001 11:30 AM
Subject: java.io.NotSerializableException: java.util.HashMap


> I am getting the following error on a JSP page that I am using struts
taglibs.
> However, I am using Sets and ArrayLists for my <selects> - not a hashmap??
>
> Any ideas?
>
> Thanks,
>
> Matt
>
> [28/Aug/2001 12:29:20:9] error: Exception: SERVLET-IO_exception:
IOException
> occurred
> Exception Stack Trace:
> java.io.NotSerializableException: java.util.HashMap$1
>         at
java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:845)
>         at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
>         at
> java.io.ObjectOutputStream.outputClassFields(ObjectOutputStream.java:1567)
>         at
> java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:453)
>         at
java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:911)
>         at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:342)
>         at
>
com.netscape.server.servlet.platformhttp.PlatformNASSession.putMemberValue(U
nknown
> Source)
>         at
>
com.netscape.server.servlet.platformhttp.PlatformNASSession.saveSession(Unkn
own
> Source)
>         at
>
com.netscape.server.servlet.platformhttp.PlatformHttpServletRequest.saveSess
ion(Unknown
> Source)
>         at
> com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
Source)
>         at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
>         at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
>         at com.kivasoft.thread.ThreadBasic.run(Native Method)
>         at java.lang.Thread.run(Thread.java:479)
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/