Я получаю NotSerializableException
при выключении Glassfish (3.1) из-за HtmlSelectOneMenu
. Я использую HtmlSelectOneMenu
в других компонентах контроллера, но они не привязаны к компоненту поддержки, как этот. Это происходит только в том случае, если на сервере активны сессии.
Как можно избежать исключений при запуске / остановке Glassfish для ограниченного компонента JSF?
Контроллер класса
@ManagedBean
@SessionScoped
...
public class ActivityController implements Serializable {
..
private DataModel<MyObjcet> items = null;
private HtmlSelectOneMenu myMenu;
...
Исключение
INFO: PWC2785: Cannot serialize session attribute activityController for session a4591e053e65effc743dade67eef
java.io.NotSerializableException: javax.faces.component.html.HtmlSelectOneMenu
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:2067)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
at org.apache.catalina.session.StandardManager.writeSessions(StandardManager.java:699)
at org.apache.catalina.session.StandardManager.doUnloadToFile(StandardManager.java:618)
at org.apache.catalina.session.StandardManager.unload(StandardManager.java:589)
at org.apache.catalina.session.StandardManager.stop(StandardManager.java:879)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5509)
at com.sun.enterprise.web.WebModule.stop(WebModule.java:529)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1049)
at com.sun.enterprise.web.WebContainer.unloadWebModule(WebContainer.java:2191)
at com.sun.enterprise.web.WebContainer.unloadWebModule(WebContainer.java:2146)
at com.sun.enterprise.web.WebApplication.stop(WebApplication.java:151)
at org.glassfish.internal.data.EngineRef.stop(EngineRef.java:169)
at org.glassfish.internal.data.ModuleInfo.stop(ModuleInfo.java:302)
at org.glassfish.internal.data.ApplicationInfo.stop(ApplicationInfo.java:314)
at com.sun.enterprise.v3.server.ApplicationLifecycle.unload(ApplicationLifecycle.java:997)
at com.sun.enterprise.v3.server.ApplicationLifecycle.disable(ApplicationLifecycle.java:1952)
at com.sun.enterprise.v3.server.ApplicationLoaderService.stopApplication(ApplicationLoaderService.java:443)
at com.sun.enterprise.v3.server.ApplicationLoaderService.preDestroy(ApplicationLoaderService.java:411)
at com.sun.hk2.component.AbstractCreatorInhabitantImpl.dispose(AbstractCreatorInhabitantImpl.java:83)
at com.sun.hk2.component.SingletonInhabitant.release(SingletonInhabitant.java:81)
at com.sun.hk2.component.EventPublishingInhabitant.release(EventPublishingInhabitant.java:108)
at com.sun.hk2.component.LazyInhabitant.release(LazyInhabitant.java:133)
at com.sun.enterprise.v3.server.AppServerStartup.stop(AppServerStartup.java:415)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.stop(GlassFishImpl.java:88)
at com.sun.enterprise.v3.admin.StopServer.doExecute(StopServer.java:70)
at com.sun.enterprise.v3.admin.StopDomainCommand.execute(StopDomainCommand.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.run(CommandRunnerImpl.java:383)