You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tiles.apache.org by "Nicolas Le Bas (JIRA)" <ji...@apache.org> on 2012/04/29 14:14:53 UTC

[jira] [Resolved] (TILES-547) NoSuchDefinitionException appears randomly when using wildcard/regex-based definitions with l10n

     [ https://issues.apache.org/jira/browse/TILES-547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Le Bas resolved TILES-547.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0.x
                   2.2.3
         Assignee: Nicolas Le Bas

Analysis:
There is an internal cache for non-wildcard definitions (and another for resolved wildcard definitions). This cache was used when loading raw definitions, too. 
So when a parent locale was already loaded, it was found in the cache, but only the non-wildcard definitions were found.

Disabling that cache in the context of raw definitions has solved the issue.

Consequences:
Sightly slower definition loading upon the first request for each locale (before the cache is loaded).
                
> NoSuchDefinitionException appears randomly when using wildcard/regex-based definitions with l10n
> ------------------------------------------------------------------------------------------------
>
>                 Key: TILES-547
>                 URL: https://issues.apache.org/jira/browse/TILES-547
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core
>    Affects Versions: 2.2.x, 3.0.x
>            Reporter: Nicolas Le Bas
>            Assignee: Nicolas Le Bas
>             Fix For: 2.2.3, 3.0.x
>
>
> For instance, the selenium test suits leads to this exception for /freemarker/testinsertdefinition_wildcard.ftl, unless the browser is configured for the locale it_IT:
> org.apache.tiles.definition.NoSuchDefinitionException: freemarker.test.definitionOne.messageHello
> 	org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:625)
> 	org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
> 	org.apache.tiles.template.InsertDefinitionModel.end(InsertDefinitionModel.java:104)
> 	org.apache.tiles.freemarker.template.InsertDefinitionFMModel.execute(InsertDefinitionFMModel.java:72)
> 	freemarker.core.Environment.visit(Environment.java:262)
> 	freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
> 	freemarker.core.Environment.visit(Environment.java:209)
> 	freemarker.core.MixedContent.accept(MixedContent.java:92)
> 	freemarker.core.Environment.visit(Environment.java:209)
> 	freemarker.core.Environment.process(Environment.java:189)
> 	freemarker.template.Template.process(Template.java:237)
> 	freemarker.ext.servlet.FreemarkerServlet.process(FreemarkerServlet.java:458)
> 	freemarker.ext.servlet.FreemarkerServlet.doGet(FreemarkerServlet.java:397)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> 	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> 	org.apache.tiles.test.filter.SecurityWrappingFilter.doFilter(SecurityWrappingFilter.java:56)
> The problem does not occur if we request the page directly on a freshly started instance.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira