You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "Craig Doremus (JIRA)" <ji...@apache.org> on 2006/05/05 21:57:28 UTC

[jira] Updated: (PLUTO-239) Missing error message key in properties file results in an ambiquous log entry

     [ http://issues.apache.org/jira/browse/PLUTO-239?page=all ]

Craig Doremus updated PLUTO-239:
--------------------------------

        Summary: Missing error message key in properties file results in an ambiquous log entry  (was: Mismatching error message key/translation pair resulting to ambiquous log entry.)
    Description: 
Apache Tomcat produced a following line when request dispacher couldn't be created. 

ERROR org.apache.pluto.core.PortletInvoker - Cannot find message associated with key error.portlet.invoker.dispatcher

The given message key (here "error.portlet.invoker.dispatcher", but there are more in the same file) doesn't have a value in LocalString.properties or at least one of them is misspelled.

The causal issue is the handling of the missing key, which throws a MissingResourceException. Here is the pertinent code in StringManager.getStringInternal():
  try {
            str = bundle.getString(key);
  } catch (MissingResourceException mre) {
            str = "Cannot find message associated with key '" + key + "'";
  }
If key is missing there should be a fallback of displaying the key followed by all of the arguments sent in as parameters in the call to StringManager.getString(). Also, if the key is missing there should, in my opinion, be a separate log entry for that fact, preferrably just as warning.
 


  was:
Apache Tomcat produced a following line when request dispacher couldn't be created. 

ERROR org.apache.pluto.core.PortletInvoker - Cannot find message associated with key error.portlet.invoker.dispatcher

The given message key (here "error.portlet.invoker.dispatcher", but there are more in the same file) doesn't have a counterpair in LocalString.properties or at least one of them is misspelled.

The problem is that the original problem is not what is outputted to the log as a result of...
  try {
            str = bundle.getString(key);
  } catch (MissingResourceException mre) {
            str = "Cannot find message associated with key '" + key + "'";
  }
...but it is either tranlation with arguments inserted or as a fallback just the key followed by all of the arguments. If translation is missing that should in my opinion be a separate log entry preferrably just as warning.
 



Edited for clarity

> Missing error message key in properties file results in an ambiquous log entry
> ------------------------------------------------------------------------------
>
>          Key: PLUTO-239
>          URL: http://issues.apache.org/jira/browse/PLUTO-239
>      Project: Pluto
>         Type: Bug

>   Components: portlet container
>     Versions: Current CVS
>     Reporter: Tuomas Kiviaho
>     Priority: Trivial
>      Fix For: 1.1.0

>
> Apache Tomcat produced a following line when request dispacher couldn't be created. 
> ERROR org.apache.pluto.core.PortletInvoker - Cannot find message associated with key error.portlet.invoker.dispatcher
> The given message key (here "error.portlet.invoker.dispatcher", but there are more in the same file) doesn't have a value in LocalString.properties or at least one of them is misspelled.
> The causal issue is the handling of the missing key, which throws a MissingResourceException. Here is the pertinent code in StringManager.getStringInternal():
>   try {
>             str = bundle.getString(key);
>   } catch (MissingResourceException mre) {
>             str = "Cannot find message associated with key '" + key + "'";
>   }
> If key is missing there should be a fallback of displaying the key followed by all of the arguments sent in as parameters in the call to StringManager.getString(). Also, if the key is missing there should, in my opinion, be a separate log entry for that fact, preferrably just as warning.
>  

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira