1 2 Previous Next 24 Replies Latest reply on Sep 16, 2008 3:17 PM by iradix Go to original post
      • 15. Re: Facelets scanning for .taglib.xml is broken in trunk
        alesj

         

        "scott.stark@jboss.org" wrote:
        If JarFile supported a JarInputStream I would look at support a JarURLConnection from the handler, but you have to have a path to a file as far as I can see.

        I would say hacking the facelets code to create patch Classpath to try to use a JarInputStream to find the taglib descriptiors is the best approach. There will be a patched facelets jars required, and we give back the patch.

        I've hacked this sandbox env:
        - http://anonsvn.jboss.org/repos/jbossas/projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/deployer/facelets/test/FaceletsUnitTestCase.java

        For the packed.jar case I don't see how are we gonna do that.
        Since our BaseClassLoader.getResource("META-INF/") returns URL that points to VFS's SynthenticDirEntryHandler.
        And this one currently doesn't know to do much:
         public InputStream openStream() throws IOException
         {
         throw new IOException("Directories cannot be opened");
         }
        


        Any ideas on how to handle this still in no-VFS-aware way?

        • 16. Re: Facelets scanning for .taglib.xml is broken in trunk
          alesj

           

          "alesj" wrote:

          Any ideas on how to handle this still in no-VFS-aware way?

          I should give up on the forum more often. :-)
          An instance after I posted this I had 2 hack ideas.

          OK, I hacked this one, and it works. :-)

           private static void searchFromURL(Set result, String prefix, String suffix, URL url) throws IOException
           {
           boolean done = false;
           InputStream is = getInputStream(url);
           if (is != null)
           {
           try
           {
           ZipInputStream zis;
           if (is instanceof ZipInputStream)
           zis = (ZipInputStream)is;
           else
           zis = new ZipInputStream(is);
           ZipEntry entry = zis.getNextEntry();
           String urlString = url.toExternalForm();
           while (entry != null)
           {
           String entryName = entry.getName();
           if (entryName.endsWith(suffix))
           {
           result.add(new URL(urlString + entryName));
           }
           entry = zis.getNextEntry();
           }
           done = true;
           }
           catch (Exception ignore)
           {
           }
           }
           if (done == false && prefix.length() > 0)
           {
           String urlString = url.toExternalForm();
           String[] split = prefix.split("/");
           prefix = join(split, false);
           String end = join(split, true);
           int p = urlString.lastIndexOf(end);
           url = new URL(urlString.substring(0, p));
           searchFromURL(result, prefix, suffix, url);
           }
           }
          
           private static String join(String[] split, boolean full)
           {
           String join = "";
           for (int j =0; j < split.length - (full ? 0 : 1); j++)
           join += split[j];
           return join;
           }
          
           private static InputStream getInputStream(URL url)
           {
           try
           {
           return url.openStream();
           }
           catch (Throwable t)
           {
           return null;
           }
           }
          


          Good enough?

          • 17. Re: Facelets scanning for .taglib.xml is broken in trunk
            iradix

            The associated JIRA issue is marked as fixed in JBoss 5.0.0.CR1, yet as far as I can tell the most recent release of facelets, 1.1.14 does not deploy correctly on CR1. I'm getting the same error as originally discussed. Am I missing something?

            • 18. Re: Facelets scanning for .taglib.xml is broken in trunk
              alesj

              Are you sure you're using the right (patched) Facelets jar?

              • 19. Re: Facelets scanning for .taglib.xml is broken in trunk
                iradix

                I wasn't but that's kind of the point. The bug was marked as fixed (changed to open today) but that doesn't seem to apply when the latest stable version still doesn't deploy correctly.

                • 20. Re: Facelets scanning for .taglib.xml is broken in trunk
                  iradix

                  I take back that part about the status being changed. I was looking at another bug. The rest of the statement applies however. When JBoss 5 goes GA and people who aren't using seam or aren't using the facelets jar from the seam lib folder can't deploy their apps..... it just seems like there is a better solution than "use this version of the library".

                  • 21. Re: Facelets scanning for .taglib.xml is broken in trunk
                    alesj

                     

                    "iradix" wrote:
                    it just seems like there is a better solution than "use this version of the library".

                    Which is?
                    If you know it, please post it here. ;-)


                    • 22. Re: Facelets scanning for .taglib.xml is broken in trunk
                      iradix

                      You're right, I should have seen that coming :) I've gotten a bit sidetracked though, it wasn't the solution that I had an issue with, it was the idea that this was marked fixed as of 5.0.0.CR1 and it's really not. Seems more to me like something that won't be fixed, but can be worked around if you use facelets 1.1.15.B1 and if that was documented better people like me who run across the problem won't suffer as big of a headache from it. Hopefully this post will help with that.

                      • 23. Re: Facelets scanning for .taglib.xml is broken in trunk
                        pmuir

                        iradix, why don't you write a blog about getting Seam working in JBoss 5 and include the gotchas like this...

                        • 24. Re: Facelets scanning for .taglib.xml is broken in trunk
                          iradix

                          You know Pete, I've never really grasped onto this whole newfangled blogging trend, but that does strike me as a pretty good idea. Where would you suggest posting it? I'm a little blitzed at the moment but around the end of the month when I've had some more time with the combo I could probably put something together.

                          1 2 Previous Next