You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by James Carman <ja...@carmanconsulting.com> on 2011/11/19 19:40:52 UTC

CDI Library Implementation Question...

I'm having a bit of trouble with my CDI library's example.  I'm not
sure if I'm attempting to do something that I shouldn't expect to work
or if my library isn't working correctly.  I've got a couple of links
on my page:

        add(new Link("convBegin")
        {
            @Override
            public void onClick()
            {
                conversation.begin();
                setResponsePage(this.getPage().getClass());
            }

            @Override
            public boolean isVisible()
            {
                return conversation.isTransient();
            }
        });
        add(new Link("convEnd")
        {
            @Override
            public void onClick()
            {
                conversation.end();
                setResponsePage(this.getPage().getClass());
            }

            @Override
            public boolean isVisible()
            {
                return !conversation.isTransient();
            }
        });

If I comment out the setResponsePage() calls, it will blow up when I
click the "convEnd" link because it's eventually resolving to a
BufferedResponseRequestHandler and I get this in the logs:

11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - New request cycle!
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Request handler
ListenerInterfaceRequestHandler resolved, searching for "cid" request
parameter...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Found request
parameter "cid"!
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Resuming conversation 2...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Saving
non-transient conversation id 2 to HomePage page's metadata...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Saving
non-transient conversation id 2 to page parameters...
11-19@13:36:25 DEBUG (Conversation)     - WELD-000318 Returned
long-running conversation 2 to transient
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Removing ended
conversation id 2 from url ?2&cid=2...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Removing ended
conversation id 2 from url ?2-3.ILinkListener-login&cid=2...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Removing ended
conversation id 2 from url ?2-3.ILinkListener-convBegin&cid=2...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Removing ended
conversation id 2 from url ?2&cid=2...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Removing
conversation id 2 from HomePage page's metadata...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Removing
conversation id parameter (2) from page parameters...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Abandoning
transient conversation...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - New request cycle!
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Request handler
BufferedResponseRequestHandler resolved, searching for "cid" request
parameter...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Found request
parameter "cid"!
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Resuming conversation 2...
11-19@13:36:25 DEBUG (CdiRequestCycleListener)     - Conversation id
not found, initiating transient conversation...
11-19@13:36:25 ERROR (DefaultExceptionMapper)     - Unexpected error occurred
org.jboss.weld.context.NonexistentConversationException: WELD-000321
No conversation found to restore for id 2

When I have the setResponse() page calls in, this is what the log looks like:

11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - New request cycle!
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Request handler
ListenerInterfaceRequestHandler resolved, searching for "cid" request
parameter...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Found request
parameter "cid"!
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Resuming conversation 3...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Saving
non-transient conversation id 3 to HomePage page's metadata...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Saving
non-transient conversation id 3 to page parameters...
11-19@13:37:55 DEBUG (Conversation)     - WELD-000318 Returned
long-running conversation 3 to transient
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Removing
conversation id 3 from HomePage page's metadata...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Removing
conversation id parameter (3) from page parameters...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Abandoning
transient conversation...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - New request cycle!
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Request handler
RenderPageRequestHandler resolved, searching for "cid" request
parameter...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Conversation id
not found, initiating transient conversation...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Abandoning
transient conversation...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - New request cycle!
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Request handler
BufferedResponseRequestHandler resolved, searching for "cid" request
parameter...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Conversation id
not found, initiating transient conversation...
11-19@13:37:55 DEBUG (CdiRequestCycleListener)     - Abandoning
transient conversation...

My question is, am I just trying to do something silly by leaving
those setResponsePage() calls out or is this some sort of funkiness
that I need to account for in my CDI library?