incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harry Metske (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (JSPWIKI-659) NotSerializableException on Tomcat restart , UserManager not Serializable
Date Sun, 13 Jan 2013 16:46:14 GMT

    [ https://issues.apache.org/jira/browse/JSPWIKI-659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13552234#comment-13552234
] 

Harry Metske commented on JSPWIKI-659:
--------------------------------------

Digging a bit deeper in JSONRPCBridge, I read that it is not necessary to put it in the session.
You can use the Global Bridge in that case.
The JavaDoc says :
{noformat}
* The JSONRPCServlet looks for a session specific bridge object
* under the attribute <code>"JSONRPCBridge"</code> in the HttpSession
* associated with the request (without creating a session if one does
* not already exist). If it can't find a session specific bridge instance,
* it will default to invoking against the global bridge.
* <p />
* Using a session specific bridge allows you to export certain object 
* instances or classes only to specific users, and of course these instances
* could be stateful and contain data specific to the user's session.
{noformat}

That is also what JSPWiki does if it cannot get it from the session (line 120 in JSONRPCManager):
{noformat}
        if( bridge == null) bridge = JSONRPCBridge.getGlobalBridge();

{noformat}

As JP mentioned, there are two more RPCCallable classes (JSONSearch, JSONTracker), but they
are registered with the Global Bridge, so they do not have the Serialization issue.
The JSONUserModule BTW is also registered with the Global Bridge, see line 120 in UserManager
{noformat}
        JSONRPCManager.registerGlobalObject( "users", new JSONUserModule(this), new AllPermission(null)
);
{noformat}

I will attach a new patch again to complete disable session scope JSONBridge , and only use
the Global Bridge.

Am I missing something ?


                
> NotSerializableException on Tomcat restart , UserManager not Serializable
> -------------------------------------------------------------------------
>
>                 Key: JSPWIKI-659
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-659
>             Project: JSPWiki
>          Issue Type: Bug
>          Components: Core & storage
>    Affects Versions: 2.8.3, 2.9.1
>         Environment: apache-tomcat-6.0.16
>            Reporter: Vasilij Pupkin
>            Assignee: Harry Metske
>            Priority: Minor
>         Attachments: ff.patch
>
>
> If you stop Tomcat using ctrl-C and restart it again, there is a NotSerializableException
on the console. Looks like this has no consequences, but still it should not be.
> SCHWERWIEGEND: IOException while loading persisted sessions: java.io.WriteAbortedException:
writing
> aborted; java.io.NotSerializableException: com.ecyrd.jspwiki.auth.UserManager$JSONUserModule
> java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.ecyrd.jspwiki.
> auth.UserManager$JSONUserModule
>         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333)
>         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
>    <<< SKIPPED >>>
> Starting up background thread: WatchDog for 'JSPWiki'.
> 17.03.2008 11:40:43 org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on http-8080
> 17.03.2008 11:40:43 org.apache.jk.common.ChannelSocket init
> INFO: JK: ajp13 listening on /0.0.0.0:8009
> 17.03.2008 11:40:43 org.apache.jk.server.JkMain start
> INFO: Jk running ID=0 time=0/31  config=null
> 17.03.2008 11:40:43 org.apache.catalina.startup.Catalina start
> INFO: Server startup in 4239 ms

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message