All actions executed twice
telenko.lfeys.reference.be May 8, 2008 12:53 PMHello,
I have posted about this problem before, but I have new information available on it and I am hoping at some point someone will be able to give me a clue on this one.
I am using seam 1.2.1 on JBoss 4.0.5.
All the actions in my application are executed twice, whether I call them using an h:commandButton, an s:button, an s:link, ...
I have added a phaseTracker to retrieve some information about the request, and I actually see the whole request cycle being execute twice.
Below is the log trace of a post with validation errors.
12:31:34,453 INFO [STDOUT] BEFORE RESTORE_VIEW(1) 12:31:34,546 INFO [STDOUT] AFTER RESTORE_VIEW(1): en 12:31:34,562 INFO [STDOUT] BEFORE APPLY_REQUEST_VALUES(2): en 12:31:34,578 WARN [org.apache.myfaces.renderkit.html.HtmlRenderKitImpl] Unsupported component-family/renderer-type: org.jboss.seam.ui.Forma ttedText/javax.faces.Text 12:31:34,578 WARN [javax.faces.component.UIComponentBase] No Renderer found for component {Component-Path : [Class: javax.faces.component.U IViewRoot,ViewId: /app/home.xhtml][Class: javax.faces.component.html.HtmlForm,Id: searchform][Class: be.belgacom.my1x07.front.web.facelets.U IFormattedText,Id: _id59]} (component-family=org.jboss.seam.ui.FormattedText, renderer-type=javax.faces.Text) 12:31:34,578 INFO [STDOUT] AFTER APPLY_REQUEST_VALUES(2): en 12:31:34,578 INFO [STDOUT] BEFORE PROCESS_VALIDATIONS(3): en 12:31:34,578 INFO [STDOUT] AFTER PROCESS_VALIDATIONS(3): en 12:31:34,593 INFO [STDOUT] MessageListener - Before RENDER_RESPONSE(6) 12:31:34,593 INFO [STDOUT] MessageListener - Locale: en 12:31:34,593 INFO [STDOUT] MessageListener - Processing searchform:nameOrActivity 12:31:34,593 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.ContentManager] Item found in cache for locale nl: type=SearchformByName ; 12:31:34,593 INFO [STDOUT] MessageListener - FieldRef found for searchform:nameOrActivity 12:31:34,593 INFO [STDOUT] MessageListener - Message found for searchform:nameOrActivity: mandatory 12:31:34,593 INFO [STDOUT] Creating new contentManager 12:31:34,609 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.NuxeoManager] Searching nuxeo: SELECT * FROM ErrorMessages 12:31:34,640 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.NuxeoManager] Results found: 1 12:31:34,656 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.ContentManager] Stored item in cache: type=ErrorMessages; 12:31:34,765 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.ContentManager] Stored item in cache for locale en: type=ErrorMessages; 12:31:34,765 INFO [STDOUT] MessageListener - MessageText: Please specify a value for '{0}' 12:31:34,765 INFO [STDOUT] MessageListener - Processing searchform:city 12:31:34,765 INFO [STDOUT] MessageListener - FieldRef found for searchform:city 12:31:34,765 INFO [STDOUT] MessageListener - Message found for searchform:city: mandatory 12:31:34,765 INFO [STDOUT] MessageListener - MessageText: Please specify a value for '{0}' 12:31:34,765 INFO [STDOUT] BEFORE RENDER_RESPONSE(6): en ... 12:31:34,812 WARN [org.apache.myfaces.renderkit.html.HtmlRenderKitImpl] Unsupported component-family/renderer-type: org.jboss.seam.ui.Forma ttedText/javax.faces.Text 12:31:34,812 WARN [javax.faces.component.UIComponentBase] No Renderer found for component {Component-Path : [Class: javax.faces.component.U IViewRoot,ViewId: /app/home.xhtml][Class: javax.faces.component.html.HtmlForm,Id: searchform][Class: be.belgacom.my1x07.front.web.facelets.U IFormattedText,Id: _id59]} (component-family=org.jboss.seam.ui.FormattedText, renderer-type=javax.faces.Text) 12:31:34,812 WARN [org.apache.myfaces.renderkit.html.HtmlRenderKitImpl] Unsupported component-family/renderer-type: org.jboss.seam.ui.Forma ttedText/javax.faces.Text 12:31:34,812 WARN [javax.faces.component.UIComponentBase] No Renderer found for component {Component-Path : [Class: javax.faces.component.U IViewRoot,ViewId: /app/home.xhtml][Class: javax.faces.component.html.HtmlForm,Id: searchform][Class: be.belgacom.my1x07.front.web.facelets.U IFormattedText,Id: _id59]} (component-family=org.jboss.seam.ui.FormattedText, renderer-type=javax.faces.Text) 12:31:34,812 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.ContentManager] Item found in cache for locale nl: type=PopularSearchBox ; 12:31:34,828 INFO [STDOUT] AFTER RENDER_RESPONSE(6): en 12:31:34,968 INFO [STDOUT] BEFORE RESTORE_VIEW(1) 12:31:34,968 INFO [STDOUT] AFTER RESTORE_VIEW(1): nl 12:31:34,968 INFO [STDOUT] MessageListener - Before RENDER_RESPONSE(6) 12:31:34,968 INFO [STDOUT] MessageListener - Locale: nl 12:31:34,968 INFO [STDOUT] BEFORE RENDER_RESPONSE(6): nl 12:31:35,000 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.ContentManager] Item found in cache for locale nl: type=PopularSearchIte m; 12:31:35,046 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.ContentManager] Item found in cache for locale nl: type=SearchformByName ; 12:31:35,046 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.ContentManager] Item found in cache for locale nl: type=SearchformByPhon e; 12:31:35,046 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.ContentManager] Item found in cache for locale nl: type=SearchformByGoog le; 12:31:35,093 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.ContentManager] Item found in cache for locale nl: type=SearchformCommon ; 12:31:35,109 WARN [org.apache.myfaces.renderkit.html.HtmlRenderKitImpl] Unsupported component-family/renderer-type: org.jboss.seam.ui.Forma ttedText/javax.faces.Text 12:31:35,109 WARN [javax.faces.component.UIComponentBase] No Renderer found for component {Component-Path : [Class: javax.faces.component.U IViewRoot,ViewId: /app/home.xhtml][Class: javax.faces.component.html.HtmlForm,Id: searchform][Class: be.belgacom.my1x07.front.web.facelets.U IFormattedText,Id: _id59]} (component-family=org.jboss.seam.ui.FormattedText, renderer-type=javax.faces.Text) 12:31:35,109 WARN [org.apache.myfaces.renderkit.html.HtmlRenderKitImpl] Unsupported component-family/renderer-type: org.jboss.seam.ui.Forma ttedText/javax.faces.Text 12:31:35,109 WARN [javax.faces.component.UIComponentBase] No Renderer found for component {Component-Path : [Class: javax.faces.component.U IViewRoot,ViewId: /app/home.xhtml][Class: javax.faces.component.html.HtmlForm,Id: searchform][Class: be.belgacom.my1x07.front.web.facelets.U IFormattedText,Id: _id59]} (component-family=org.jboss.seam.ui.FormattedText, renderer-type=javax.faces.Text) 12:31:35,109 DEBUG [be.belgacom.my1x07.front.business.manager.nuxeo.ContentManager] Item found in cache for locale nl: type=PopularSearchBox ; 12:31:35,140 INFO [STDOUT] AFTER RENDER_RESPONSE(6): nl
Now there are some weird things:
- The JSF lifecycle is execute twice. See the messages from my phaseTracker (implements PhaseListener) 'AFTER...' and 'BEFORE...'
- The current locale (which should be 'nl') is not the same for both cycles. I've added the current locale in the log messages of the PhaseTracker. To retrieve the locale in the PhaseListener, I use facesContext.viewRoot.getLocale.
- The MessageListener (see messages preceded with 'MessageListener - ' doesn't find the same information in the second cycle: no values are returned from 'facesContext.getClientIdsWithMessages', so it's seems like no validation errors have occured in the second cycle.
If anyone could shed a light on this or help me in finding out more about this problem, I would be very grateful.
Cheers.
Luc Feys