You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2016/02/23 15:48:28 UTC

[Bug 59054] New: CrawlerSessionManagerValve is not serializable, and throws exception when passing itself as sessionAttribute

https://bz.apache.org/bugzilla/show_bug.cgi?id=59054

            Bug ID: 59054
           Summary: CrawlerSessionManagerValve is not serializable, and
                    throws exception when passing itself as
                    sessionAttribute
           Product: Tomcat 7
           Version: 7.0.64
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Connectors
          Assignee: dev@tomcat.apache.org
          Reporter: kubas121@o2.pl

During first request to the application when user agent matches crawler pattern
the execution reaches the point where it tries to store itself in
sessionAttribute (s1.setAttribute(this.getClass().getName(), this)). Since
CrawlerSessionManagerValve does not implement Serializable it throws exception:

java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute
org.apache.catalina.valves.CrawlerSessionManagerValve
    at
org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1465)
    at
org.apache.catalina.session.StandardSession.setAttribute(StandardSession.java:1426)
    at
org.apache.catalina.session.StandardSessionFacade.setAttribute(StandardSessionFacade.java:154)
    at
org.apache.catalina.valves.CrawlerSessionManagerValve.invoke(CrawlerSessionManagerValve.java:190)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
    at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)



I was able to fix this bug by modyfing source code to implement Serializable
interface.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 59054] CrawlerSessionManagerValve is not serializable, and throws exception when passing itself as sessionAttribute

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59054

Kuba <ku...@o2.pl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #2 from Kuba <ku...@o2.pl> ---
Thanks for reply. Can you explain how  distributed enviroment can influence
this behaviour.
The class is not serializable so any StandardSession.setAttribute() call with
it as a parameter will end up throwing exception, won't it? Apart from that I
am not using distributed enviroment.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 59054] CrawlerSessionManagerValve is not serializable, and throws exception when passing itself as sessionAttribute

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59054

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
You should only see this error in a distributed environment.

The CrawlerSessionManagementValve isn't intended to be distributed so I have
added to the list of attributes that are excluded from this process. This fix
has been applied to 9.0.x (for 9.0.0.M4 onwards), 8.0.x (for 8.0.33 onwards)
and 7.0.x for 7.0.69 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 59054] CrawlerSessionManagerValve is not serializable, and throws exception when passing itself as sessionAttribute

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59054

Remy Maucherat <re...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Remy Maucherat <re...@apache.org> ---
If you have further questions, please use the user list, bugzilla is not a
support forum. Thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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