Details
Description
15:40:03,946 WARN [Parameters] Parameters: Invalid chunk ignored.
15:40:07,174 INFO [lifecycle] WARNING: FacesMessage(s) have been
enqueued, but may not have been displayed.
yet the faces messages are displayed.
-
Hide
- ICE-1900.war
- 6.20 MB
- Tyler Johnson
-
- META-INF/MANIFEST.MF 0.0 kB
- xmlhttp/css/.../tbot-off-mid-top.gif 0.8 kB
- xmlhttp/css/.../tree_nav_middle_open.gif 0.2 kB
- xmlhttp/css/.../tbot-on-left-top.gif 0.1 kB
- xmlhttp/css/xp/css-images/tab-over.gif 0.6 kB
- xmlhttp/css/.../css-images/cal_off.gif 0.6 kB
- xmlhttp/css/.../css-images/over-left-top.gif 0.1 kB
- xmlhttp/css/.../tree_line_middle_node.gif 0.1 kB
- xmlhttp/css/.../tree_nav_bottom_open.gif 0.1 kB
- xmlhttp/css/.../css-images/arrow-first.gif 0.2 kB
- xmlhttp/css/.../css-images/Tab_RtTop.gif 0.1 kB
- xmlhttp/.../tree_nav_top_open_no_siblings.gif 0.1 kB
- xmlhttp/css/.../css-images/on-left-mid.gif 0.1 kB
- xmlhttp/css/xp/css-images/remove.gif 0.1 kB
- xmlhttp/css/.../arrow-previous-dis.gif 0.9 kB
- xmlhttp/css/.../tree_nav_middle_open.gif 0.4 kB
- xmlhttp/css/.../cal_arrow_left_dis.gif 0.9 kB
- xmlhttp/css/.../css-images/over-mid-mid.gif 0.1 kB
- xmlhttp/css/.../tree_nav_top_closess.gif 0.1 kB
- xmlhttp/css/xp/css-images/node_close.gif 0.1 kB
- xmlhttp/css/.../tree_line_blank.gif 0.1 kB
- xmlhttp/css/.../off-right-top-dis.gif 0.0 kB
- xmlhttp/css/.../selection_spacer.gif 0.0 kB
- xmlhttp/css/.../Tab_Btm_LftBtm_off.gif 0.1 kB
- xmlhttp/css/.../node_open_first.gif 0.1 kB
- xmlhttp/css/.../Tab_Btm_RtBtm_off.gif 0.1 kB
- xmlhttp/css/.../css-images/PnlHdr_down.gif 1 kB
- xmlhttp/css/.../css-images/over-left-bot.gif 0.0 kB
- xmlhttp/css/.../tree_folder_doc.gif 0.3 kB
- xmlhttp/css/.../tree_line_blank.gif 0.1 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Test case intended for deployment on Tomcat 6. It is a standard ICEfaces project with no additional libraries used.
So the problem appears to be this:
The Sun RI basically makes use of the interaction between 3 things.
1) The FacesContext (implemented by FacesContextImpl and BridgeFacesContext) which provides the API for adding and getting the FacesMessages.
2) The com.sun.faces.util.RequestStateManager which is an internal utility for storing and retrieving "private" request-scoped attributes.
3) The RenderResponsePhase which does some message processing before and after the view is rendered.
Here's the relevant code from RenderResponsePhase.execute:
try {
//Setup message display LOGGER.
if (LOGGER.isLoggable(Level.INFO)) {
Iterator<String> clientIdIter = facesContext.getClientIdsWithMessages();
//If Messages are queued
if (clientIdIter.hasNext()) {
Set<String> clientIds = new HashSet<String>();
//Copy client ids to set of clientIds pending display.
while (clientIdIter.hasNext())
RequestStateManager.set(facesContext,
RequestStateManager.CLIENT_ID_MESSAGES_NOT_DISPLAYED,
clientIds);
}
}
//render the view
facesContext.getApplication().getViewHandler().
renderView(facesContext, facesContext.getViewRoot());
//display results of message display LOGGER
if (LOGGER.isLoggable(Level.INFO) &&
RequestStateManager.containsKey(facesContext,
RequestStateManager.CLIENT_ID_MESSAGES_NOT_DISPLAYED)) {
//remove so Set does not get modified when displaying messages.
Set<String> clientIds = TypedCollections.dynamicallyCastSet(
(Set) RequestStateManager.remove(facesContext,
RequestStateManager.CLIENT_ID_MESSAGES_NOT_DISPLAYED),
String.class);
if (!clientIds.isEmpty()) {
//Display each message possibly not displayed.
StringBuilder builder = new StringBuilder();
for (String clientId : clientIds) {
Iterator<FacesMessage> messages = facesContext.getMessages(clientId);
while (messages.hasNext())
}
LOGGER.log(Level.INFO, "jsf.non_displayed_message", builder.toString());
}
}
} catch (IOException e)
In the RenderResponsePhase, before rendering the view, it retrieves all the messages for the pending client ids with messages and adds them to the RequestStateManager. After the view has been rendered, it checks to see if any of those entries are still there. The actual logic for clearing these pending ids is in the FacesContextImpl.getMessage and getMessages methods. It calls the RequestStateManager to return the pending message(s) and additionally clears it/them.
One of the oddities is that the logic in the RenderResponsePhase is all wrapped in LOGGER.isLoggable(Level.INFO) checks. So none of this will happen if the logging level is set higher. The other oddity is that the act of adding the messages doesn't invoke the RequestStateManager at all so our own BridgeFacesContext does all the message handling fine. It's just that when we retrieve the messages for display, we aren't clearing out this secret stash of messages that was only added by the RenderResponsePhase because of a certain logging level.
Not sure of the best way to fix this as it's not really a functional problem per se. More of a logging anomaly that's relying on secret information to guess that something 'might' be going wrong. The 'WARNING' is actually part of the LogStrings.properties file for the message and not actually the logging level (which is INFO).
I've checked in a new class that reflectively detects if the Sun's RequestStateManager is available. If it is, the same logic is applied to remove pending messages.
The new ICEfaces RequestStateManagerDelegate.clearMessages(FacesContext fc, String clientID) method is only working for messages associated with a component. The "FacesMessage(s) have been enqueued" annoyance is still happening for GLOBAL messages (where clientID == null).
Request that the "if" condition in the clearMessages method be changed to the following, so that it clears out GLOBAL messages too:
public static void clearMessages(FacesContext fc, String clientID) {
// if (!detected || fc == null || clientID == null) {
if (!detected || fc == null)
Set pendingMessageIds = getPendingMessageIds(fc);
if (pendingMessageIds != null && !pendingMessageIds.isEmpty())
}
Neil,
As this JIRA is already closed (and related changes released in a prior version), I've created a new JIRA for the follow-up issue that you've reported above. See ICE-5177 for future reference on the issue.
I'm seeing this with ICEfaces 1.7 RC1 + JSF 1.2 + JBoss AS 4.2.2