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

Igor Vaynberg commented on WICKET-4468:
---------------------------------------

fix for this breaks wicket-cdi.

imagine a component that is visible only if the user is logged in. to do this 
it overrides onconfigure() { setvisible(logins.getcurrentuser()!=null); }

where logins is a cdi bean.

Page#isPageStateless() is called as soon as the page is pulled from the page 
store, which means now onconfigure() is called when wicket cdi retrieves the 
page instance and before it is able to figure out what conversation to wrap the 
page in.

{code}
org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active 
contexts for scope type javax.enterprise.context.ConversationScoped
        at 
org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:664)
        at 
org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:77)
        at 
org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:124)
        at xxx.dao.UserLogManager.findLoggedInUser(UserLogManager.java:122)
        at 
xxx.security.WeldUserFactories.getLoggedInUser(WeldUserFactories.java:67)
        at 
xxx.security.WeldUserFactories.getLoggedInAdmin(WeldUserFactories.java:226)
        at 
xxx.security.WeldUserFactories.getCurrentUser(WeldUserFactories.java:239)
        at 
xxx.lms.frontend.template.FrontEndTemplate$LogoutLink.isVisible(FrontEndTemplate.java:725)
        at org.apache.wicket.Component.determineVisibility(Component.java:4381)
        at org.apache.wicket.Component.isVisibleInHierarchy(Component.java:2160)
        at org.apache.wicket.Component.isStateless(Component.java:2081)
        at org.apache.wicket.Page$2.component(Page.java:503)
        at org.apache.wicket.Page$2.component(Page.java:500)
        at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:143)
        at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:161)
        at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:122)
        at 
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:866)
        at org.apache.wicket.Page.isPageStateless(Page.java:498)
        at 
org.apache.wicket.page.AbstractPageManager.touchPage(AbstractPageManager.java:123)
        at 
org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:105)
        at 
org.apache.wicket.page.PageManagerDecorator.getPage(PageManagerDecorator.java:50)
        at 
org.apache.wicket.page.PageAccessSynchronizer$2.getPage(PageAccessSynchronizer.java:257)
        at 
org.apache.wicket.DefaultMapperContext.getPageInstance(DefaultMapperContext.java:117)
        at 
org.apache.wicket.request.handler.PageProvider.getStoredPage(PageProvider.java:292)
        at 
org.apache.wicket.request.handler.PageProvider.hasPageInstance(PageProvider.java:380)
        at 
org.apache.wicket.request.handler.RenderPageRequestHandler.isPageInstanceCreated(RenderPageRequestHandler.java:181)
        at 
net.ftlines.wicket.cdi.ConversationPropagator.getPage(ConversationPropagator.java:261)
        at 
net.ftlines.wicket.cdi.ConversationPropagator.onRequestHandlerResolved(ConversationPropagator.java:111)
        at 
org.apache.wicket.request.cycle.RequestCycleListenerCollection$5.notify(RequestCycleListenerCollection.java:145)
        at 
org.apache.wicket.request.cycle.RequestCycleListenerCollection$5.notify(RequestCycleListenerCollection.java:142)
        at 
org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
        at 
org.apache.wicket.request.cycle.RequestCycleListenerCollection.onRequestHandlerResolved(RequestCycleListenerCollection.java:141)
        at 
org.apache.wicket.request.cycle.RequestCycleListenerCollection$5.notify(RequestCycleListenerCollection.java:145)
        at 
org.apache.wicket.request.cycle.RequestCycleListenerCollection$5.notify(RequestCycleListenerCollection.java:142)
        at 
org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
        at 
org.apache.wicket.request.cycle.RequestCycleListenerCollection.onRequestHandlerResolved(RequestCycleListenerCollection.java:141)
        at 
org.apache.wicket.request.cycle.RequestCycleListenerCollection$5.notify(RequestCycleListenerCollection.java:145)
        at 
org.apache.wicket.request.cycle.RequestCycleListenerCollection$5.notify(RequestCycleListenerCollection.java:142)
        at 
org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
        at 
org.apache.wicket.request.cycle.RequestCycleListenerCollection.onRequestHandlerResolved(RequestCycleListenerCollection.java:141)
        at 
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:254)
        at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
        at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
        at 
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:185)
        at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:241)
{code}

                
> Stateful components which are invisible force page to be stateful
> -----------------------------------------------------------------
>
>                 Key: WICKET-4468
>                 URL: https://issues.apache.org/jira/browse/WICKET-4468
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.5.5
>            Reporter: Sebastian Gooren
>            Assignee: Martin Grigorov
>            Priority: Minor
>             Fix For: 1.5.6, 6.0.0-RC1
>
>
> Stateful components which are not rendered (setVisible(false)) force the page 
> to be stateful.
> Page#isPageStateless() visits all components to check 
> Component#isStateless(), whether they are visible or not.
> Please change this so invisible components no longer force a page to be 
> stateful.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to