Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D5C85122F6 for ; Sat, 10 May 2014 22:32:52 +0000 (UTC) Received: (qmail 47704 invoked by uid 500); 10 May 2014 21:56:03 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 47019 invoked by uid 500); 10 May 2014 21:56:03 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 46773 invoked by uid 99); 10 May 2014 21:56:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 May 2014 21:56:02 +0000 Date: Sat, 10 May 2014 21:56:02 +0000 (UTC) From: "Prakash Udupa (JIRA)" To: dev@myfaces.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (TRINIDAD-2473) Improve diagnostic support for resource bundle feature in skinning framework MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Prakash Udupa created TRINIDAD-2473: --------------------------------------- Summary: Improve diagnostic support for resource bundle feature in skinning framework Key: TRINIDAD-2473 URL: https://issues.apache.org/jira/browse/TRINIDAD-2473 Project: MyFaces Trinidad Issue Type: Bug Components: Skinning Affects Versions: 2.1.0-core Reporter: Prakash Udupa We had difficulty diagnosing a skinning issue where the server logs reported some translated keys not being able to be resolved to its value in the resource bundle attached to the skins. There are messages like these two in the logs: 1. <17.02.2014 21:23 Uhr MEZ> <[ServletContext@797966157[app:de_arbeitsagentur_portal module:apps path:/apps spec-version:2.5 version:1.0.0.5.159]] Servlet failed with Exception java.util.MissingResourceException: Can't find resource for bundle at org.apache.myfaces.trinidadinternal.skin.SkinImpl.getTranslatedValue(SkinImpl. java:183) 2. <17.02.2014 21:23 Uhr MEZ> <[ServletContext@797966157[app:de_arbeitsagentur_portal module:apps path:/apps spec-version:2.5 version:1.0.0.5.159]] Servlet failed with Exception java.util.MissingResourceException: Can't find resource for bundle at org.apache.myfaces.trinidadinternal.skin.SkinImpl.getTranslatedValue(SkinImpl. java:183) ======= These are not as useful because they do not give the details of skin or the bundle class that is expected to resolve it, or how in the skin hierarchy this was resolved (or lack of). Relevant code is here: ======= In RenderingContext.getTranslatedString(): try { return getSkin().getTranslatedString(getLocaleContext(), key); } catch (MissingResourceException mre) { // Instead of halting execution, return "??????", // just like JSF and JSTL will do, and log a severe error _LOG.severe("CANNOT_GET_RESOURCE_KEY", new String[]{key, getSkin().getId()}); return "???" + key + "???"; } This would not tell if the bundle was read properly in the first place. The issue is more evident in this code in SkinImpl.getTranslatedValue(): if (translatedValue == null) { throw new MissingResourceException("Can't find resource for bundle", getBundleName(), key); } Although the bundle name and key is passed to the exception, it does not get included in the message in the log, this information should be included in the first parameter. ======== This issue is to track the needed improvement in logging here to improve debug-ability. Will provide a patch soon. -- This message was sent by Atlassian JIRA (v6.2#6252)