[Clustering/JBoss] - problem caused by <distributable/>
by ddai
Hi all
Now I think I have found the trouble maker: Once I add that tag into the web.xml, a problem shows up. When I deleted it, everything looks fine. Does that mean I need to modify the application codes?
Here is the outline of the error. Please help me. This is very important to me.
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: setAttribute: Non-serializable attribute
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
InputValidationFilter.doFilter(InputValidationFilter.java:54)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute
org.jboss.web.tomcat.tc5.session.ClusteredSession.setAttribute(ClusteredSession.java:532)
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:129)
org.apache.jsp.gcsMenu_jsp._jspService(gcsMenu_jsp.java:450)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
InputValidationFilter.doFilter(InputValidationFilter.java:54)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
--------------------------------------------------------------------------------
Apache Tomcat/5.5.20
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057888#4057888
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057888
18Â years, 10Â months
[JBoss Seam] - Handling database exceptions
by shakenbrain
When persisting an entity at the end of a conversation, how can one handle a database exception, like a constraint violation, without invalidating the session? Here's the the basic scenario:
1. Start a conversation (flushMode=MANUAL); display edit page
2. Call a method to persist the edited object; calls entityManager.flush()
3. A unique constraint is violated; EntityExistsException is thrown
4. Exeption is caught and a FacesMessage created
5. Control returns to the edit page
6. Edit page accesses database to fetch entities for a <s:selectItems> tag
7. Exception thrown because transaction no longer valid
Gavin states somewhere on this forum that it's a good idea to check the database before persisting an object to see if a constraint would be violated. I'd prefer to keep my constraint logic in the database- it means a lot less coding in action methods. For example, I don't have to worry about whether the object getting flushed is new or not. Also, verifying a constraint won't be violated before persisting does not guarantee that the constraint won't be violated in the database (ie, another session inserts an identical object at the same time). Validating constraints in the control layer just isn't robust enough.
So, is there a way to keep the current session intact when a database exception is thrown? Section 5.3.1 in the reference manual seems to indicate that the answer is 'no'. If that's true, that seems to be a pretty major shortcoming (of EJB3, I think).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057884#4057884
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057884
18Â years, 10Â months