You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Udo Schnurpfeil (JIRA)" <de...@myfaces.apache.org> on 2013/09/23 11:20:13 UTC

[jira] [Resolved] (TOBAGO-1295) Loading themes on JBoss 7.x.x with vfs protocol

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

Udo Schnurpfeil resolved TOBAGO-1295.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0
                   2.0.0-alpha-2
    
> Loading themes on JBoss 7.x.x with vfs protocol
> -----------------------------------------------
>
>                 Key: TOBAGO-1295
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-1295
>             Project: MyFaces Tobago
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-alpha-2
>         Environment: Jboss 7.1.1, Jboss 7.2.0
>            Reporter: Thomas Schmitz
>            Assignee: Udo Schnurpfeil
>             Fix For: 2.0.0-alpha-2, 2.0.0
>
>
> JBoss seemingly has changed its VFS scheme name from vfszip to vfs in version 7.x.x. Therefore it is not possible to deploy a tobago application on it as tobago does not know how to handle it.
> I tried to fix it in ResourceLocator by simply changing the part where the old vfszip protocol is handled from 'protocol.equals("vfszip")' to 'protocol.startsWith("vfs").
> But it seems that vfszip and vfs must be handled in different ways as the part where the jar or zip file is loaded  with the ZipInputStream does not work:
> zipStream = new ZipInputStream(stream);
> while (zipStream.available() > 0) {
>       ZipEntry nextEntry = zipStream.getNextEntry();
>       if (nextEntry == null || nextEntry.isDirectory()) {
>         continue;
>       }
>       String name = "/" + nextEntry.getName();
>       if (name.startsWith(prefix)) {
>         addResource(resources, name, skipPrefix);
>       }
> }
> In fact it produces an infinite loop because zipStream.available always returns >0 but zipStream.getNextEntry is always null.
> I found out that if I disclaim on the theme-jars and unzip them next to my WEB-INF directory they will be loaded correct. So my workaround is to comment out the part with the infinite loop.
> I am sad that I can't propose a good patch for this. The only way I found out is to use jboss-vfs API to handle the vfs scheme correct.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira