portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Woonsan Ko (JIRA)" <jetspeed-...@portals.apache.org>
Subject [jira] Assigned: (JS2-1005) NotSerializationException during restarting tomcat
Date Tue, 12 May 2009 09:39:45 GMT

     [ https://issues.apache.org/jira/browse/JS2-1005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Woonsan Ko reassigned JS2-1005:
-------------------------------

    Assignee: Randy Watler

Randy, would you fix this problem? I think you are the expert on this.

To reproduce this problem:
(1) Start tomcat (I used `./catalina.sh run')
(2) Just browse the default page
(3) Stop tomcat (I used Ctrl+C)
(4) Start tomcat again and the error comes out.

I found that the problematic session attribute was set in JetspeedProfilerImpl#setupProfilerContext().
(#809)
The ProfilerContext is a member class, so it will have a reference to its JetspeedProfilerImpl
instance which is not serializable. That's why the serialization fails.
By the way, I detected problematic session attribute with a simple HttpSessionAttributeListener
which tries to write object when added or replaced. For example,

package org.apache.jetspeed.engine;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;

public class SessionAttributeChecker implements HttpSessionAttributeListener
{
    public void attributeAdded(HttpSessionBindingEvent arg0)
    {
        checkAttributeSerializable(arg0);
    }

    public void attributeRemoved(HttpSessionBindingEvent arg0)
    {
    }

    public void attributeReplaced(HttpSessionBindingEvent arg0)
    {
        checkAttributeSerializable(arg0);
    }
    
    private void checkAttributeSerializable(HttpSessionBindingEvent arg0)
    {
        ObjectOutputStream oos = null;
        
        try
        {
            oos = new ObjectOutputStream(new ByteArrayOutputStream(512));
            oos.writeObject(arg0.getValue()); 
        }
        catch (IOException e)
        {
            System.out.println(">>> Not serializable session object: " + arg0.getName()
+ " = " + arg0.getValue());
            e.printStackTrace(System.out);
        }
        finally
        {
            try { oos.close(); } catch (Exception ce) { }
        }
    }
}


> NotSerializationException during restarting tomcat
> --------------------------------------------------
>
>                 Key: JS2-1005
>                 URL: https://issues.apache.org/jira/browse/JS2-1005
>             Project: Jetspeed 2
>          Issue Type: Bug
>    Affects Versions: 2.2.0
>         Environment: Tomcat 6.0.18
>            Reporter: Woonsan Ko
>            Assignee: Randy Watler
>             Fix For: 2.2.0
>
>
> May 12, 2009 10:21:13 AM org.apache.catalina.session.StandardManager doLoad
> SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException:
writing aborted; java.io.NotSerializableException: org.apache.jetspeed.profiler.impl.JetspeedProfilerImpl
> java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.jetspeed.profiler.impl.JetspeedProfilerImpl
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1309)
> 	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
> 	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
> 	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
> 	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
> 	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
> 	at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1441)
> 	at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:942)
> 	at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:394)
> 	at org.apache.catalina.session.StandardManager.load(StandardManager.java:321)
> 	at org.apache.catalina.session.StandardManager.start(StandardManager.java:637)
> 	at org.apache.catalina.core.ContainerBase.setManager(ContainerBase.java:438)
> 	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271)
> 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
> 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
> 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
> 	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
> 	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
> 	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
> 	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
> 	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
> 	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> 	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
> 	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
> 	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
> 	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
> 	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
> 	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
> 	at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
> 	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:585)
> 	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> 	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> Caused by: java.io.NotSerializableException: org.apache.jetspeed.profiler.impl.JetspeedProfilerImpl
> 	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)
> 	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
> 	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
> 	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
> 	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
> 	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
> 	at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1517)
> 	at org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:959)
> 	at org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:517)
> 	at org.apache.catalina.session.StandardManager.unload(StandardManager.java:463)
> 	at org.apache.catalina.session.StandardManager.stop(StandardManager.java:667)
> 	at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4519)
> 	at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924)
> 	at org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1191)
> 	at org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1162)
> 	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:313)
> 	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> 	at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1086)
> 	at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1098)
> 	at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:448)
> 	at org.apache.catalina.core.StandardService.stop(StandardService.java:584)
> 	at org.apache.catalina.core.StandardServer.stop(StandardServer.java:744)
> 	at org.apache.catalina.startup.Catalina.stop(Catalina.java:628)
> 	at org.apache.catalina.startup.Catalina$CatalinaShutdownHook.run(Catalina.java:671)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message