[ 
https://issues.apache.org/jira/browse/TILES-515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907885#action_12907885
 ] 

Bryan Keller commented on TILES-515:
------------------------------------

I attached a second test project that demonstrates the original problem.

It has the same code but is packaged a bit differently. The war only contains 
the tiles-jsp jar, as the taglib is not accessible otherwise via the 
classloader. In this example, you will need to copy the following jars into the 
Felix "bundle" dir (in addition to Pax-Web and the others): jcl-over-slf4j, 
slf4j-api, slf4j-simple, tiles-api, tiles-core, tiles-servlet, and 
tiles-template. (You can build the first test project, extract the war, and 
copy everything in WEB-INF/lib except for tiles-jsp.)

Once you start Felix and navigate to localhost:8080/tilestest, you will get an 
error to the effect of "tiles_en.xml not found". This error is the one that is 
supposed to be ignored, as this process is checking for all of the 
locale-specific view definitions, but it instead is thrown and causes 
initialization to fail.

> ResolvingLocaleUrlDefinitionDAO doesn't handle loading from war properly
> ------------------------------------------------------------------------
>
>                 Key: TILES-515
>                 URL: https://issues.apache.org/jira/browse/TILES-515
>             Project: Tiles
>          Issue Type: Bug
>    Affects Versions: 2.2.2
>            Reporter: Bryan Keller
>         Attachments: tilestest.zip, tilestest2.zip
>
>
> The BaseLocaleUrlDefinitionDAO does not handle loading view definitions 
> directly from a war bundle properly. In the loadDefinitionsFromURL() call, it 
> catches a FileNotFoundException if a definition is not found, logs a debug 
> message and continues. This is the proper way to handle situations where a 
> view definition has not been defined for a particular locale. However, when 
> loading from a resource URL (e.g. "classpath:/..." or "bundle:/"), if the 
> view definition is not found, a "FileNotFoundException is not thrown, rather 
> an IOException is. A plain IOException is not consumed, but rather thrown, 
> and prevents Tiles from initializing.
> The code is in BaseLocaleUrlDefinitionDAO, line 277. The IOException handling 
> should check if it is a resource not found error and ignore the exception if 
> so.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to