NanoContainer
  1. NanoContainer
  2. NANO-43

Serialization exception in Nanocontainer servlet framework

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-beta-1
    • Fix Version/s: 1.0-beta-1
    • Component/s: None
    • Labels:
      None
    • Environment:
      j2sdk1.4.2_03 on WinXP, Tomcat-5.0.19, Latest Pico and Nano CVS-built jars
    • Number of attachments :
      2

      Description

      I'm getting servlet session serialization exceptions on SessionObjectReference. I can't quite see why this would be since I don't see anywhere that it is stored in the session. It stores other stuff in the session, but not itself as far as I can tell. It is used in an object stored in the session, but that is within a method, not as a class variable. Well, I guess it must be being stored somewhere, otherwise this wouldn't be happening. Anyway, here's the stack trace. Hopefully someone else can find where the problem is...

      Stopping container...

      INFO: Removing web application at context path /picoservlet
      Feb 25, 2004 10:36:58 PM org.apache.catalina.session.ManagerBase log
      INFO: Cannot serialize session attribute nanocontainer.session for session F38AE433994277F54238DE419F48479A
      java.io.NotSerializableException: org.nanocontainer.servlet.SessionScopeObjectReference
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at java.util.ArrayList.writeObject(ArrayList.java:529)
      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:324)
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1446)
      at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:937)
      at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:586)
      at org.apache.catalina.session.StandardManager.unload(StandardManager.java:532)
      at org.apache.catalina.session.StandardManager.stop(StandardManager.java:734)
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4436)
      at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:995)
      at org.apache.catalina.core.StandardHostDeployer.remove(StandardHostDeployer.java:606)
      at org.apache.catalina.core.StandardHost.remove(StandardHost.java:955)
      at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1053)
      at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1030)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:396)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
      at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1166)
      at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1178)
      at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:526)
      at org.apache.catalina.core.StandardService.stop(StandardService.java:581)
      at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2379)
      at org.apache.catalina.startup.Catalina.stop(Catalina.java:643)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:618)
      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:324)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)

      Starting container...

      INFO: Processing Context configuration file URL file:D:\Java\Apache\Jakarta\jakarta-tomcat-5.0.19\conf\Catalina\localhost\picoservlet.xml
      Feb 25, 2004 10:38:45 PM org.apache.catalina.session.StandardManager doLoad
      SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.nanocontainer.servlet.SessionScopeObjectReference
      java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.nanocontainer.servlet.SessionScopeObjectReference
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
      at java.util.ArrayList.readObject(ArrayList.java:547)
      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:324)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
      at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1376)
      at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:920)
      at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:463)
      at org.apache.catalina.session.StandardManager.load(StandardManager.java:390)
      at org.apache.catalina.session.StandardManager.start(StandardManager.java:704)
      at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:542)
      at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:348)
      at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:652)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:253)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
      at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:839)
      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:324)
      at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
      at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
      at org.apache.commons.digester.Rule.end(Rule.java:276)
      at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
      at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:123)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.commons.digester.Digester.parse(Digester.java:1567)
      at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:519)
      at org.apache.catalina.core.StandardHost.install(StandardHost.java:906)
      at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:527)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:394)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1134)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:521)
      at org.apache.catalina.core.StandardService.start(StandardService.java:519)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:2345)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:594)
      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:324)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
      Caused by: java.io.NotSerializableException: org.nanocontainer.servlet.SessionScopeObjectReference
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at java.util.ArrayList.writeObject(ArrayList.java:529)
      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:324)
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1446)
      at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:937)
      at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:586)
      at org.apache.catalina.session.StandardManager.unload(StandardManager.java:532)
      at org.apache.catalina.session.StandardManager.stop(StandardManager.java:734)
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4436)
      at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:995)
      at org.apache.catalina.core.StandardHostDeployer.remove(StandardHostDeployer.java:606)
      at org.apache.catalina.core.StandardHost.remove(StandardHost.java:955)
      at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1053)
      at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1030)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:396)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
      at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1166)
      at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1178)
      at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:526)
      at org.apache.catalina.core.StandardService.stop(StandardService.java:581)
      at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2379)
      at org.apache.catalina.startup.Catalina.stop(Catalina.java:643)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:618)
      ... 6 more
      Feb 25, 2004 10:38:45 PM org.apache.catalina.session.StandardManager start
      SEVERE: Exception loading sessions from persistent storage
      java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.nanocontainer.servlet.SessionScopeObjectReference
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1278)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
      at java.util.ArrayList.readObject(ArrayList.java:547)
      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:324)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
      at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1376)
      at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:920)
      at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:463)
      at org.apache.catalina.session.StandardManager.load(StandardManager.java:390)
      at org.apache.catalina.session.StandardManager.start(StandardManager.java:704)
      at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:542)
      at org.apache.catalina.startup.ContextConfig.managerConfig(ContextConfig.java:348)
      at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:652)
      at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:253)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4222)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:850)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
      at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:839)
      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:324)
      at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252)
      at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256)
      at org.apache.commons.digester.Rule.end(Rule.java:276)
      at org.apache.commons.digester.Digester.endElement(Digester.java:1058)
      at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:123)
      at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at org.apache.commons.digester.Digester.parse(Digester.java:1567)
      at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:519)
      at org.apache.catalina.core.StandardHost.install(StandardHost.java:906)
      at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:527)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:394)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1134)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:832)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:521)
      at org.apache.catalina.core.StandardService.start(StandardService.java:519)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:2345)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:594)
      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:324)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:297)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:398)
      Caused by: java.io.NotSerializableException: org.nanocontainer.servlet.SessionScopeObjectReference
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at java.util.ArrayList.writeObject(ArrayList.java:529)
      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:324)
      at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1446)
      at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:937)
      at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:586)
      at org.apache.catalina.session.StandardManager.unload(StandardManager.java:532)
      at org.apache.catalina.session.StandardManager.stop(StandardManager.java:734)
      at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4436)
      at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:995)
      at org.apache.catalina.core.StandardHostDeployer.remove(StandardHostDeployer.java:606)
      at org.apache.catalina.core.StandardHost.remove(StandardHost.java:955)
      at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1053)
      at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1030)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:396)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
      at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1166)
      at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1178)
      at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:526)
      at org.apache.catalina.core.StandardService.stop(StandardService.java:581)
      at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2379)
      at org.apache.catalina.startup.Catalina.stop(Catalina.java:643)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:618)
      ... 6 more

        Activity

        Hide
        Miguel Paraz added a comment -

        SessionScopeObjectReference is used to hold references to objects using HttpSession attributes. Apparently, Tomcat tries to persist these on shutdown, by through serialization.

        http://www.systemmobile.com/blog/index.php?p=20&more=1&c=1&tb=1&pb=1

        It looks like users either need to make components Serializable, or NanoContainer Servlet needs to clear out the session-bound containers on shutdown.

        Can this be done from ServletContainerListener.contextDestroyed() ?

        Show
        Miguel Paraz added a comment - SessionScopeObjectReference is used to hold references to objects using HttpSession attributes. Apparently, Tomcat tries to persist these on shutdown, by through serialization. http://www.systemmobile.com/blog/index.php?p=20&more=1&c=1&tb=1&pb=1 It looks like users either need to make components Serializable, or NanoContainer Servlet needs to clear out the session-bound containers on shutdown. Can this be done from ServletContainerListener.contextDestroyed() ?
        Hide
        Jacob Kjome added a comment -

        Actually, here is what is happening. SessionScopeObjectReference is being used for two purposes.

        NOTE: See email thread on this here....
        http://lists.codehaus.org/pipermail/picocontainer-dev/2004-April/003279.html

        1. A runtime utility to manage containers in different scopes with the same interface.

        2. As a key in Picocontainer's AbstractComponentAdapter for the nested container being used to store object meant for the session scope.

        #2 is the reason why SessionScopeObjectReference is getting serialized. There is a very simple, but somewhat kludgey looking solution to this. Make SessionScopeObjectReference implement Serializable and set the HttpSession field as "transient". There is no issue with deserialization even with the null HttpSession upon deserialization since the serialized SessionScopeObjectReference is merely used as a key for the container. It is not used directly again. At runtime, a new SessionScopeObjectReference is used.

        And we defeinitey shouldn't be blowing away the session scroped container. Anything you put in a session ought to be able to persist the duration of that session. That means after the timeout, not after an application or server restart.

        One could think of this as a more general problem. Pico-based containers are Serializable. However, arbitrary objects are used as keys to items in containers, many of which aren't serializable. This could be solved by using some sort of serializable hash of the object meant to be the key, rather than the object itself. That would have prevented this issue and would allow us to not define SessionScopeObjectReference as being Serializable, since normally it shouldn't be serialized in the first place.

        So, either my solution needs to be implemented or what Picocontainer chooses to use as keys in AbstractComponentAdapter needs to be rethought.

        Jake

        Show
        Jacob Kjome added a comment - Actually, here is what is happening. SessionScopeObjectReference is being used for two purposes. NOTE: See email thread on this here.... http://lists.codehaus.org/pipermail/picocontainer-dev/2004-April/003279.html 1. A runtime utility to manage containers in different scopes with the same interface. 2. As a key in Picocontainer's AbstractComponentAdapter for the nested container being used to store object meant for the session scope. #2 is the reason why SessionScopeObjectReference is getting serialized. There is a very simple, but somewhat kludgey looking solution to this. Make SessionScopeObjectReference implement Serializable and set the HttpSession field as "transient". There is no issue with deserialization even with the null HttpSession upon deserialization since the serialized SessionScopeObjectReference is merely used as a key for the container. It is not used directly again. At runtime, a new SessionScopeObjectReference is used. And we defeinitey shouldn't be blowing away the session scroped container. Anything you put in a session ought to be able to persist the duration of that session. That means after the timeout, not after an application or server restart. One could think of this as a more general problem. Pico-based containers are Serializable. However, arbitrary objects are used as keys to items in containers, many of which aren't serializable. This could be solved by using some sort of serializable hash of the object meant to be the key, rather than the object itself. That would have prevented this issue and would allow us to not define SessionScopeObjectReference as being Serializable, since normally it shouldn't be serialized in the first place. So, either my solution needs to be implemented or what Picocontainer chooses to use as keys in AbstractComponentAdapter needs to be rethought. Jake
        Hide
        Jacob Kjome added a comment -

        Turns out there is one further issue with serializability. In Tomcat-5.0.22+, non-serializable session attribute values will be removed from the session at shutdown or application reload. This causes the KILLER_HELPER to have its valueUnbound called which will kill the container. Of course, since the session hasn't expired, the nanocontainer servlet framework will assume that components added to the session scope are still there, but them bomb out with something like the following error....

        org.picocontainer.defaults.UnsatisfiableDependenciesException: org.picoextras.servlet.sample.SomeRequestUtil doesn't have any satisfiable constructors. Unsatisfiable dependencies: [[class org.picoextras.servlet.sample.SomeCounter]]
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getGreediestSatisifableConstructor(ConstructorInjectionComponentAdapter.java:146)
        at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.instantiateComponent(ConstructorInjectionComponentAdapter.java:186)
        at org.picocontainer.defaults.InstantiatingComponentAdapter.getComponentInstance(InstantiatingComponentAdapter.java:43)
        at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:42)
        at org.picocontainer.defaults.CachingComponentAdapter.getComponentInstance(CachingComponentAdapter.java:38)
        at org.picocontainer.defaults.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:297)

        (Note that this problem will also happen in the case that someone manually removes the KILLER_HELPER from the session. The only true way to solve this is to use SessionDestroyed() rather than the KILLER_HELPER session attribute. But since sessionDestroyed() won't work properly under some containers (can't access the session because it would have already been destroyed), then this compromise is necessary)

        The only way to solve this is to make the KILLER_HELPER value serializable and make the ServletContainerListener serializable (since the anonymous class used in the KILLER_HELPER drags in its owner class at serialization time).

        Attached is a patch to allow the session container to survive app reloads and container restarts and avoid any nasty exceptions with not finding components. Changes to both ServletContainerListener.java and SessionScopeObjectReference.java are included in this patch.

        Please apply this or session container is pretty much useless across app reloads and will, at best, result in lost components in the session container with the app continuing to work, but with lost session history, and, at worst, with lots of serialization/deserialization errors and/or Picocontainer UnsatisfiableDependenciesException errors.

        Jake

        Show
        Jacob Kjome added a comment - Turns out there is one further issue with serializability. In Tomcat-5.0.22+, non-serializable session attribute values will be removed from the session at shutdown or application reload. This causes the KILLER_HELPER to have its valueUnbound called which will kill the container. Of course, since the session hasn't expired, the nanocontainer servlet framework will assume that components added to the session scope are still there, but them bomb out with something like the following error.... org.picocontainer.defaults.UnsatisfiableDependenciesException: org.picoextras.servlet.sample.SomeRequestUtil doesn't have any satisfiable constructors. Unsatisfiable dependencies: [ [class org.picoextras.servlet.sample.SomeCounter] ] at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getGreediestSatisifableConstructor(ConstructorInjectionComponentAdapter.java:146) at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.instantiateComponent(ConstructorInjectionComponentAdapter.java:186) at org.picocontainer.defaults.InstantiatingComponentAdapter.getComponentInstance(InstantiatingComponentAdapter.java:43) at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:42) at org.picocontainer.defaults.CachingComponentAdapter.getComponentInstance(CachingComponentAdapter.java:38) at org.picocontainer.defaults.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:297) (Note that this problem will also happen in the case that someone manually removes the KILLER_HELPER from the session. The only true way to solve this is to use SessionDestroyed() rather than the KILLER_HELPER session attribute. But since sessionDestroyed() won't work properly under some containers (can't access the session because it would have already been destroyed), then this compromise is necessary) The only way to solve this is to make the KILLER_HELPER value serializable and make the ServletContainerListener serializable (since the anonymous class used in the KILLER_HELPER drags in its owner class at serialization time). Attached is a patch to allow the session container to survive app reloads and container restarts and avoid any nasty exceptions with not finding components. Changes to both ServletContainerListener.java and SessionScopeObjectReference.java are included in this patch. Please apply this or session container is pretty much useless across app reloads and will, at best, result in lost components in the session container with the app continuing to work, but with lost session history, and, at worst, with lots of serialization/deserialization errors and/or Picocontainer UnsatisfiableDependenciesException errors. Jake
        Jacob Kjome made changes -
        Field Original Value New Value
        Attachment nanococontainer-servlet_serializability.patch [ 11901 ]
        Hide
        Jacob Kjome added a comment -

        Updated patch to apply against new CVS location. No functional changes between this patch and the original one.

        Jake

        Show
        Jacob Kjome added a comment - Updated patch to apply against new CVS location. No functional changes between this patch and the original one. Jake
        Jacob Kjome made changes -
        Hide
        Konstantin Pribluda added a comment -

        Applied an will be commited in 10 minutes

        Show
        Konstantin Pribluda added a comment - Applied an will be commited in 10 minutes
        Konstantin Pribluda made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 1.0-beta-1 [ 10147 ]
        Assignee Konstantin Pribluda [ ko5tik ]
        Hide
        Jacob Kjome added a comment -

        Unless I'm looking at the wrong CVS tree (or did things get moved to SVN????), I haven't seen this applied. Why is this closed?

        Jake

        Show
        Jacob Kjome added a comment - Unless I'm looking at the wrong CVS tree (or did things get moved to SVN????), I haven't seen this applied. Why is this closed? Jake
        Hide
        Jörg Schaible added a comment -

        Reopened, since patches are still not applied

        Show
        Jörg Schaible added a comment - Reopened, since patches are still not applied
        Jörg Schaible made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Hide
        Konstantin Pribluda added a comment -

        I must have forgot to commit my work repository.
        Will do this in my private....

        Show
        Konstantin Pribluda added a comment - I must have forgot to commit my work repository. Will do this in my private....
        Hide
        Konstantin Pribluda added a comment -

        not it is commited.....

        Show
        Konstantin Pribluda added a comment - not it is commited.....
        Konstantin Pribluda made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Konstantin Pribluda
            Reporter:
            Jacob Kjome
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: