Friday, September 2, 2011

java.lang.IllegalArgumentException

Few days ago i absorbed below mentioned error on JBoss console,

06:34:22,276 ERROR [ContainerBase] Servlet.service() for servlet jsp threw exception
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute
at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1293)
at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1254)
at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:130)
at com.vignette.portal.website.internal.HttpSessionWrapper.setAttribute(HttpSessionWrapper.java:107)
at org.apache.jasper.runtime.PageContextImpl.doSetAttribute(PageContextImpl.java:340)
at org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:319)
at org.apache.jsp.survey.question_jsp._jspService(question_jsp.java:431)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Solution :
I traced back the root cause of the error. I went to that particular JSP file and found that particular java class which was throwing this error.

I implemented interface Serializable for that class

eg :

class Xyz implements Serializable { }

No comments:

Post a Comment