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

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

I added a simple Tiles test project to create a war file. This uses a gradle 
script BTW, so you'll need to download gradle 0.9rc1 to build it as it is. (The 
manifest needs to be tweaked for OSGi, and I'm not proficient in how to do it 
w/in a pom.xml).

Once you have the war, you can install it in Tomcat to ensure it works.

After that, download the Apache Felix 
(http://felix.apache.org/site/downloads.cgi). You'll need the framework 
distribution, the config admin bundle, and the file install bundle. Download 
Pax-Web (http://wiki.ops4j.org/display/paxweb/Download). You'll need the Jetty 
bundle, JSP support bundle , and the WAR extender bundle.

Unzip the Felix distro. Copy the config admin, file intall, and all of the Pax 
Web bundles into the "bundles" directory. Create a directory named "load" at 
the root of the Felix directory (same level as bundle, bin, etc). Copy the war 
file into this "load" directory.

Cd to the root Felix dir. Run Felix with "java -jar bin/felix.jar". Everything 
should start up. Navigate to "localhost:8080/tilestest/simple.jsp". This should 
show a page with the date and time, to verify JSPs are working. Now go to 
"localhost:8080/tilestest". You'll get a tiles exception.

This is a slightly different exception than the one I described initially, 
however.


> 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
>
>
> 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