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

SegFault commented on WICKET-3470:
----------------------------------

Thanks for reproduction case.

First, I don't know much about servlet api, no more about wicket init 
mechanism, so I might say stupid things.

To my mind, it's a good idea to map Wicket-App lifecyle to a Servlet lifecycle, 
not only at destroying time, but at loading time too, because there is no clue 
about when it will be instantiate, and this make wicket very "container 
implementation dependent". I can't think about concrete case by now to support 
this idea, but it make sense to me.

I don't see what is the problem with the need to add a <listener> for each app. 
There is no other way which maintain compatibility with Servlet2.5 ; wicket is 
just before a brand new release, good time to add this in migration guide, no ? 

" the only problem I see is that there is no one to clean the static 
org.apache.wicket.page.PersistentPageManager.managers" <= maybe a stupid 
question, but how does this behave in case of many context reloading (for 
example in developpement mode), is this cleaned up by container ? or this will 
end up with a PermGen space error ?

> Can't write session to disk with tomcat : Servlet is destroyed before 
> serialization
> -----------------------------------------------------------------------------------
>
>                 Key: WICKET-3470
>                 URL: https://issues.apache.org/jira/browse/WICKET-3470
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC1
>         Environment: Windows 7 x64
> apache-tomcat-6.0.32-windows-x86
> (Running from Eclipse view, Faceted project)
>            Reporter: SegFault
>              Labels: persistent, session, storage, tomcat
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> Hi,
> When I stop my tomcat, I have the following error :
> GRAVE: Exception au déchargement des sessions vers le stockage persistant 
> (persistent storage)
> java.lang.IllegalStateException: PageManager for application wicket not 
> registered.
>       at 
> lm.lbx.application.PersistentPageManager$SessionEntry.getPageStore(PersistentPageManager.java:86)
>       at 
> lm.lbx.application.PersistentPageManager$SessionEntry.writeObject(PersistentPageManager.java:197)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>       at java.lang.reflect.Method.invoke(Unknown Source)
>       at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
>       at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
>       at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
>       at java.io.ObjectOutputStream.writeObject0(Unknown Source)
>       at java.io.ObjectOutputStream.writeObject(Unknown Source)
>       at 
> org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1561)
>       at 
> org.apache.catalina.session.StandardSession.writeObjectData(StandardSession.java:1004)
>       at 
> org.apache.catalina.session.StandardManager.doUnload(StandardManager.java:528)
>       at 
> org.apache.catalina.session.StandardManager.unload(StandardManager.java:469)
>       at 
> org.apache.catalina.session.StandardManager.stop(StandardManager.java:678)
>       at 
> org.apache.catalina.core.StandardContext.stop(StandardContext.java:4875)
>       at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1106)
>       at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1106)
>       at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:468)
>       at 
> org.apache.catalina.core.StandardService.stop(StandardService.java:604)
>       at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
>       at org.apache.catalina.startup.Catalina.stop(Catalina.java:662)
>       at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>       at java.lang.reflect.Method.invoke(Unknown Source)
>       at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
>       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
> After a little digging, it's because tomcat first unload the servlet mapping 
> and destroy the servlet, and then, ask for serialization. I'm not sure it's a 
> wiket bug, tell me if i have to report it against tomcat.
> Here is the trace of the destroy :
> Thread [main] (Suspended (breakpoint at line 357 in PersistentPageManager))   
>       PersistentPageManager.destroy() line: 357       
>       PageAccessSynchronizer$1(PageManagerDecorator).destroy() line: 86       
>       LibellexApplication(Application).internalDestroy() line: 658    
>       LibellexApplication(WebApplication).internalDestroy() line: 470 
>       WicketFilter.destroy() line: 456        
>       ApplicationFilterConfig.release() line: 357     
>       StandardContext.filterStop() line: 4106 
>       StandardContext.stop() line: 4869       
>       StandardHost(ContainerBase).stop() line: 1106   
>       StandardEngine(ContainerBase).stop() line: 1106 
>       StandardEngine.stop() line: 468 
>       StandardService.stop() line: 604        
>       StandardServer.stop() line: 788 
>       Catalina.stop() line: 662       
>       Catalina.start() line: 629      
>       NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not 
> available [native method]  
>       NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available   
>       DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not 
> available       
>       Method.invoke(Object, Object...) line: not available    
>       Bootstrap.start() line: 289     
>       Bootstrap.main(String[]) line: 414      
> And the trace requesting serialization :
> Thread [main] (Suspended (breakpoint at line 83 in 
> PersistentPageManager$SessionEntry))       
>       PersistentPageManager$SessionEntry.getPageStore() line: 83      
>       PersistentPageManager$SessionEntry.writeObject(ObjectOutputStream) 
> line: 197    
>       NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not 
> available [native method]  
>       NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available   
>       DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not 
> available       
>       Method.invoke(Object, Object...) line: not available    
>       ObjectStreamClass.invokeWriteObject(Object, ObjectOutputStream) line: 
> not available     
>       ObjectOutputStream.writeSerialData(Object, ObjectStreamClass) line: not 
> available       
>       ObjectOutputStream.writeOrdinaryObject(Object, ObjectStreamClass, 
> boolean) line: not available  
>       ObjectOutputStream.writeObject0(Object, boolean) line: not available    
>       ObjectOutputStream.writeObject(Object) line: not available      
>       StandardSession.writeObject(ObjectOutputStream) line: 1561      
>       StandardSession.writeObjectData(ObjectOutputStream) line: 1004  
>       StandardManager.doUnload() line: 528    
>       StandardManager.unload() line: 469      
>       StandardManager.stop() line: 678        
>       StandardContext.stop() line: 4875       
>       StandardHost(ContainerBase).stop() line: 1106   
>       StandardEngine(ContainerBase).stop() line: 1106 
>       StandardEngine.stop() line: 468 
>       StandardService.stop() line: 604        
>       StandardServer.stop() line: 788 
>       Catalina.stop() line: 662       
>       Catalina.start() line: 629      
>       NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not 
> available [native method]  
>       NativeMethodAccessorImpl.invoke(Object, Object[]) line: not available   
>       DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: not 
> available       
>       Method.invoke(Object, Object...) line: not available    
>       Bootstrap.start() line: 289     
>       Bootstrap.main(String[]) line: 414      
> Well at this time, a simple dirty hack is to bypass destroy chain to avoid  
> removal of app from managers properties of class PersistentPageManager. But I 
> would like to have a real clean solution.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to