[Yanel-dev] weird locale-related exceptions
Josias Thöny
josias.thoeny at wyona.com
Fri Mar 16 21:47:10 CET 2007
Hi Paloma,
Paloma Gomez wrote:
> Hi all,
>
> I keep getting the following exception message (see below) from time to
> time since a few days ago. At the beginning I thought it was my fault,
> since it seemed to be related to changes I had introduced and fixing the
> bugs these changes had introduced seem to solve the problem. However,
> after an update and with no changes in my tree, I keep getting it from
> time to time. The last time I got it was when I tried the following url:
>
> http://127.0.0.1:8080/yanel/yanel-website/en/about.html?yanel.resource.meta
>
> It seems to be caused by the setYanelOutput method in YanelServlet. I
> must leave now but I will look into it on monday and let you know about
> my findings.
I suspect the error is caused by the i18n transformer:
public I18nTransformer2(String messages, String language) {
currentLocale = new Locale(language);
messageBundle = ResourceBundle.getBundle(messages, currentLocale);
}
If the language is "es" but there is no spanish translation property
file, it will throw an exception. At least that's what I thought at
first. It doesn't seem to be quite as simple, though. When I request a
non-existing language, I don't get this error. I guess it also takes the
default locale into account, which is "en" on my computer.
I have no idea why you hit this error only sometimes and not always...
Josias
>
> Have a nice weekend,
>
> Paloma
>
> ----------------------------------------------------------------------------------------------------------------------
>
>
> 11075 2007-03-16 17:55:37,707 [http-8080-Processor25] ERROR
> org.wyona.yanel.servlet.YanelServlet.setYanelOutput():1638 - Can't find
> bundle for base name global, locale es
> java.util.MissingResourceException: Can't find bundle for base name
> global, locale es
> at
> java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:836)
>
> at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:805)
> [...]
> 11078 2007-03-16 17:55:37,710 [http-8080-Processor25] ERROR
> org.wyona.yanel.servlet.YanelServlet.doGet():240 - Can't find bundle
> for base name global, locale es
> javax.servlet.ServletException: Can't find bundle for base name global,
> locale es
> at
> org.wyona.yanel.servlet.YanelServlet.setYanelOutput(YanelServlet.java:1639)
> at
> org.wyona.yanel.servlet.YanelServlet.getContent(YanelServlet.java:538)
> at org.wyona.yanel.servlet.YanelServlet.doGet(YanelServlet.java:237)
> at org.wyona.yanel.servlet.YanelServlet.service(YanelServlet.java:180)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>
> [...]
> 11083 2007-03-16 17:55:37,715 [http-8080-Processor25] ERROR
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/yanel].[YanelServlet].invoke():253
> - Servlet.service() para servlet YanelServlet lanzó excepción
> javax.servlet.ServletException: Can't find bundle for base name global,
> locale es
> at
> org.wyona.yanel.servlet.YanelServlet.setYanelOutput(YanelServlet.java:1639)
> at
> org.wyona.yanel.servlet.YanelServlet.getContent(YanelServlet.java:538)
> at org.wyona.yanel.servlet.YanelServlet.doGet(YanelServlet.java:237)
> at org.wyona.yanel.servlet.YanelServlet.service(YanelServlet.java:180)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>
> [...]
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
>
>
>
> _______________________________________________
> Yanel-development mailing list
> Yanel-development at wyona.com
> http://wyona.com/cgi-bin/mailman/listinfo/yanel-development
>
More information about the Yanel-development
mailing list