Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphicImageManager should implement serializable #7

Open
99sono opened this issue Jun 2, 2015 · 0 comments
Open

GraphicImageManager should implement serializable #7

99sono opened this issue Jun 2, 2015 · 0 comments

Comments

@99sono
Copy link

99sono commented Jun 2, 2015

Hi,

Under glassfish I had to tune the GrpahicImageManager and make it serializable.

public class GraphicImageManager implements HttpSessionBindingListener, java.io.Serializable {

JSF was saving the bean to the session state came the exception:

''''
java.lang.IllegalArgumentException: PWC2788: setAttribute: Non-serializable attribute with name GraphicImageManager
at org.apache.catalina.session.ManagerBase.checkSessionAttribute(ManagerBase.java:832)
at org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1713)
at org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:178)
at com.sun.faces.context.SessionMap.put(SessionMap.java:141)

  @Override
public Object put(String key, Object value) {
    Util.notNull("key", key);
    HttpSession session = getSession(true);
    Object result = session.getAttribute(key);
    if (value != null && ProjectStage.Development.equals(stage) && !(value instanceof Serializable)) {
        if (LOGGER.isLoggable(Level.WARNING)) {
            LOGGER.log(Level.WARNING,
                       "jsf.context.extcontext.sessionmap.nonserializable",
                       new Object[]{key, value.getClass().getName()});
        }
    }
    //noinspection NonSerializableObjectBoundToHttpSession
    boolean doSet = true;
    if (null != value && null != result) {
        doSet = ! result.equals(value);
    }
    if (doSet) {
        session.setAttribute(key, value);
    }
    return (result);
}






at com.sun.faces.context.SessionMap.put(SessionMap.java:61)
at com.sun.faces.mgbean.BeanManager$ScopeManager$SessionScopeHandler.handle(BeanManager.java:578)
at com.sun.faces.mgbean.BeanManager$ScopeManager.pushToScope(BeanManager.java:457)
at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:268)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:244)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:116)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:103)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:224)

''''

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant