[ 
https://issues.apache.org/jira/browse/TAPESTRY-1568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555753#action_12555753
 ] 

Franz Amador commented on TAPESTRY-1568:
----------------------------------------

This fixed the problem for me.  In PageTesterContext.getResource, change line 49

            return f.toURL();

to this

            return f.toURI().toURL();

(which just follows the suggestion in the JavaDoc for File.toURL).

P.S. FWIW I also recommend changing line 41 from
        File f = new File(_contextRoot + path);
to
        File f = new File(_contextRoot, path);
This doesn't fix anything, but using string concatenation to build the path 
from a File and a String when there's a perfectly good constructor that does it 
for you seems cheesy.

> Using PageTester and having a project with spaces in the name creates an 
> exception
> ----------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1568
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1568
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.5
>            Reporter: Joel Wiegman
>
> If you have spaces in the path to your Tapestry project, calling 
> PageTester.renderPage causes the following exception:
> java.lang.RuntimeException: java.net.URISyntaxException: Illegal character in 
> path at index 18: file:/C:/Documents and Settings/jwiegman/My 
> Documents/bts-dev/workspaces/store-portal/storeportal/src/main/webapp/WEB-INF/status/Start.html
>             at 
> org.apache.tapestry.internal.util.URLChangeTracker.add(URLChangeTracker.java:64)
>             at 
> org.apache.tapestry.internal.services.ComponentTemplateSourceImpl.parseTemplate(ComponentTemplateSourceImpl.java:143)
>             at 
> org.apache.tapestry.internal.services.ComponentTemplateSourceImpl.getTemplate(ComponentTemplateSourceImpl.java:126)
>             at 
> $ComponentTemplateSource_11326329ebe.getTemplate($ComponentTemplateSource_11326329ebe.java)
>             at 
> org.apache.tapestry.internal.services.PageLoaderProcessor.loadTemplateForComponent(PageLoaderProcessor.java:427)
>             at 
> org.apache.tapestry.internal.services.PageLoaderProcessor.workComponentQueue(PageLoaderProcessor.java:712)
>             at 
> org.apache.tapestry.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:393)
>             at 
> org.apache.tapestry.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:59)
>             at $PageLoader_11326329ecb.loadPage($PageLoader_11326329ecb.java)
>             at 
> org.apache.tapestry.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:63)
>             at $PagePool_11326329ec1.checkout($PagePool_11326329ec1.java)
>             at 
> org.apache.tapestry.internal.services.RequestPageCacheImpl.getByClassName(RequestPageCacheImpl.java:58)
>             at 
> org.apache.tapestry.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:49)
>             at 
> $RequestPageCache_11326329ebb.get($RequestPageCache_11326329ebb.java)
>             at 
> $RequestPageCache_11326329eba.get($RequestPageCache_11326329eba.java)
>             at 
> org.apache.tapestry.internal.services.PageLinkHandlerImpl.handle(PageLinkHandlerImpl.java:57)
>             at 
> $PageLinkHandler_11326329eb1.handle($PageLinkHandler_11326329eb1.java)
>             at 
> org.apache.tapestry.internal.test.PageLinkInvoker.invoke(PageLinkInvoker.java:61)
>             at org.apache.tapestry.test.PageTester.invoke(PageTester.java:184)
>             at 
> org.apache.tapestry.test.PageTester.renderPage(PageTester.java:144)
>             at 
> com.btservices.storeportal.web.pages.status.TestStart.testStoreHierarchy(TestStart.java:26)

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to