JSF managed bean causing java.io.NotSerializableException during Tomcat deployment
Asked Answered
F

1

12

At deployment of my webApplication on Tomcat 7 I am getting the console output below. After restarting the server twice or three times it works without exceptions.

I am using JSF, Tomcat and an RMI connection to businesslogic part (which shouldn't matter here?)

@EJB in @ViewScoped managed bean causes java.io.NotSerializableException - Here I read about Serialization. But in that case client side state saving was activated, which is not the case in my webApp (as far as my web.xml tells me). So is serialization of my viewscoped ManagedBeans necessary or is there another failure?

Here my startup console output (Sry for that german parts in it):

28.01.2011 20:25:05 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Programme\Java\jdk1.6.0_21\jre\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Programme/Java/jre6/bin/client;C:/Programme/Java/jre6/bin;C:/Programme/Java/jre6/lib/i386;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Programme\Gemeinsame Dateien\Lenovo;C:\Programme\ATI Technologies\ATI.ACE\Core-Static;C:\Programme\Java\jdk1.6.0_20;C:\StudiPortal\TortoiseSVN\bin;C:\StudiPortal\apache-maven-2.0.11\bin;C:\Programme\Intel\WiFi\bin\;C:\Programme\ThinkPad\ConnectUtilities;C:\Programme\GTK2-Runtime\bin;C:\Programme\OpenVPN\bin
28.01.2011 20:25:05 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNUNG: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:shapeyourbody' did not find a matching property.
28.01.2011 20:25:06 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
28.01.2011 20:25:06 org.apache.coyote.ajp.AjpProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
28.01.2011 20:25:06 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 481 ms
28.01.2011 20:25:06 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
28.01.2011 20:25:06 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.5
28.01.2011 20:25:09 com.sun.faces.config.ConfigureListener contextInitialized
INFO: Mojarra 2.0.3 (FCS b03) für Kontext '/shapeyourbody' wird initialisiert.
28.01.2011 20:25:10 com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy-Annotationen vorhanden.  Verwaltete Bean-Methoden, die mit diesen Annotationen markiert sind, lassen die entsprechenden Annotationen verarbeiten.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse 'org.apache.myfaces.custom.aliasbean.AliasBeanTagHandler' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse 'org.apache.myfaces.custom.aliasbean.AliasBeansScopeTagHandler' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse 'org.apache.myfaces.custom.calendar.HtmlInputCalendarTagHandler' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse 'org.apache.myfaces.custom.date.HtmlInputDateTagHandler' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse 'org.apache.myfaces.custom.schedule.ScheduleTagHandler' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse 'org.apache.myfaces.custom.tabbedpane.HtmlPanelTabbedPaneTagHandler' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processComponent
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse 'org.apache.myfaces.custom.tree.taglib.TreeTagHandler' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processHandlerClass
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse '[handler-class: null]' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processHandlerClass
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse '[handler-class: null]' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processHandlerClass
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse '[handler-class: null]' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 com.sun.faces.config.processor.FaceletTaglibConfigProcessor processHandlerClass
WARNUNG: JSF1029:  Die Anwendung hat Version 2.0 (entweder ausdrücklich durch die Version von /WEB-INF/faces-config.xml oder eine fehlende /WEB-INF/faces-confg.xml), jedoch hängt Klasse '[handler-class: null]' von einer Legacy-Facelet-Klasse ab.  Das von dieser Klasse registrierte Facelet-Artefakt wird nicht registriert.
28.01.2011 20:25:10 org.apache.catalina.session.StandardManager doLoad
SCHWERWIEGEND: IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.dhbw.stg.wwi2008c.mopro.ui.viewscoped.MachineReservationListBean
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.dhbw.stg.wwi2008c.mopro.ui.viewscoped.MachineReservationListBean
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.HashMap.readObject(HashMap.java:1030)
    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.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.HashMap.readObject(HashMap.java:1030)
    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.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.HashMap.readObject(HashMap.java:1030)
    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.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.HashMap.readObject(HashMap.java:1030)
    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.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1576)
    at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1059)
    at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284)
    at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)
    at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:465)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5025)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:738)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:289)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:442)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:674)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:596)
    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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
Caused by: java.io.NotSerializableException: org.dhbw.stg.wwi2008c.mopro.ui.viewscoped.MachineReservationListBean
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at java.util.HashMap.writeObject(HashMap.java:1001)
    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:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at java.util.HashMap.writeObject(HashMap.java:1001)
    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:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at java.util.HashMap.writeObject(HashMap.java:1001)
    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:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at java.util.HashMap.writeObject(HashMap.java:1001)
    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:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1652)
    at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:1076)
    at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:406)
    at org.apache.catalina.session.StandardManager.unload(StandardManager.java:353)
    at org.apache.catalina.session.StandardManager.stopInternal(StandardManager.java:492)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:216)
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5195)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:216)
    at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1074)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:216)
    at org.apache.catalina.core.ContainerBase.stopInternal(ContainerBase.java:1074)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:216)
    at org.apache.catalina.core.StandardService.stopInternal(StandardService.java:498)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:216)
    at org.apache.catalina.core.StandardServer.stopInternal(StandardServer.java:695)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:216)
    at org.apache.catalina.startup.Catalina.stop(Catalina.java:663)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:630)
    ... 6 more
28.01.2011 20:25:10 org.apache.catalina.session.StandardManager startInternal
SCHWERWIEGEND: Exception loading sessions from persistent storage
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.dhbw.stg.wwi2008c.mopro.ui.viewscoped.MachineReservationListBean
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.HashMap.readObject(HashMap.java:1030)
    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.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.HashMap.readObject(HashMap.java:1030)
    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.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.HashMap.readObject(HashMap.java:1030)
    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.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at java.util.HashMap.readObject(HashMap.java:1030)
    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.invokeReadObject(ObjectStreamClass.java:974)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
    at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1576)
    at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1059)
    at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284)
    at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)
    at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:465)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5025)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:738)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:289)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:442)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:674)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:596)
    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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
Caused by: java.io.NotSerializableException: org.dhbw.stg.wwi2008c.mopro.ui.viewscoped.MachineReservationListBean
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at java.util.HashMap.writeObject(HashMap.java:1001)
    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:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1509)
    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1474)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at java.util.HashMap.writeObject(HashMap.java:1001)
    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:1461)
    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1338)
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1146)
    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
    at java.util.HashMap.writeObject(HashMap.java:1001)
    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)
    ... 6 more
28.01.2011 20:25:11 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
28.01.2011 20:25:11 org.apache.coyote.ajp.AjpProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
28.01.2011 20:25:11 org.apache.catalina.startup.Catalina start
INFO: Server startup in 4976 ms

Thank you for your help

Floydflss answered 28/1, 2011 at 19:45 Comment(0)
I
14

Here's the relevant bit of the trace:

SCHWERWIEGEND: Exception loading sessions from persistent storage
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.dhbw.stg.wwi2008c.mopro.ui.viewscoped.MachineReservationListBean
     ...
     at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1576)
     at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1059)
     at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284)
     at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)
     at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:465)
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
     ...

This one concerns a different problem than the question which you linked. By default, when Tomcat shutdowns, it will serialize the HttpSession to disk which will then be reloaded from disk on startup so that the endusers can just continue with the browser session without losing any session data.

In such case, any session attribute is supposed to implement Serializable. The JSF view state is by default stored in the session, including all appropriate view scoped beans. They needs to implement Serializable as well in order to survive a Tomcat shutdown/restart.

Technically, you can just ignore it. JSF will recreate the session/view scoped beans anyway when not present yet. However, the enduser won't be able to continue with the same session/view scoped data. Those exceptions won't occur when the session doesn't contain any non-serializable objects. That's why it "sometimes" works.

If you want to disable session persistence altogether so that you won't be bothered with those exceptions/warnings, then you need to add a <Manager> element with an empty pathname attribute to the <Context> element of the webapp in question.

<Context ... >
    <Manager pathname="" />
</Context>

This basically instructs Tomcat to use no session manager at all.

See also:

Interlining answered 28/1, 2011 at 19:58 Comment(9)
So it's not that big of a deal :-) Thank you bauke :-)I have to hand in my assignment for uni at monday and I have plenty of bugs -.- Bug fixing is that part of software engineering that sucks. but without most programmer wouldn't have a job I think ;-)Floydflss
@BalusC: I had a screenshot of this answer which is a little old and as such it doesn't includes the edited part. Was the sentence The JSF UIViewRoot is in essence stored in the session removed beacuse UIViewRoot doesn't implements Serializable OR some other thing went through your mind?Verne
@Shirgill: I used the wrong word to refer to the JSF view state.Interlining
@BalusC: Thanks. Are the beans also stored in the view state?Verne
@Shirgill: view scoped beans are stored in session together with view state but not inside view state. I.e. when state saving method is client, view state is stored in hidden input field in HTML, but view scoped beans are still stored in HTTP session.Interlining
@BalusC: was perplexed by your sentence the view scoped beans are stored in the partial view state here http://stackoverflow.com/questions/10337015/should-partial-state-saving-be-set-to-falseVerne
@Shirgill: that was thus changed to fix that problem. Sorry for the confusion, I'll edit that post.Interlining
@Shirgill: By the way: github.com/omnifaces/omnifaces/issues/330Interlining
@BalusC: Ah, thanks. One more thing - above you mentioned The JSF view state is by default stored in the session. Which implementation? Anghel Leonard says that in Mojarra the state is not serialized in a session.(The container deals with the serialization stuff.) JSF only stores pointers to the state in session. Or Stored in a session AND serialized in a session means different thingsVerne

© 2022 - 2024 — McMap. All rights reserved.