Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2096

JBoss 4.2.3 Classpath scanning fails for nested paths

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.4
    • Fix Version/s: 5.4
    • Component/s: tapestry-ioc
    • Labels:

      Description

      When creating pages in a subdirectory under 'pages', the ClasspathScannerImpl class recursively calls scanDir with only the last part of the package name and not the entire package name resulting in pages not being able to be loaded.

      Changing the line:
      final String nestedPackagePath = fileName + "/";
      to:
      final String nestedPackagePath = packagePath + fileName + "/";

      /**

      • Scan a dir for classes. Will recursively look in the supplied directory and all sub directories.
        *
      • @param packagePath
      • Name of package that this directory corresponds to.
      • @param packageDir
      • Dir to scan for classes.
        */
        private void scanDir(String packagePath, File packageDir)
        {
        if (packageDir.exists() && packageDir.isDirectory())
        {
        for (final File file : packageDir.listFiles())
        {
        String fileName = file.getName();

      if (file.isDirectory())
      {
      final String nestedPackagePath = fileName + "/";

      queue.push(new IOWork()
      {
      public void run() throws IOException

      { scanDir(nestedPackagePath, file); }
      });
      }

      if (matcher.matches(packagePath, fileName))
      { matches.add(packagePath + fileName); }
      }
      }
      }



      /**
      * Scan a dir for classes. Will recursively look in the supplied directory and all sub directories.
      *
      * @param packagePath
      * Name of package that this directory corresponds to.
      * @param packageDir
      * Dir to scan for classes.
      */
      private void scanDir(String packagePath, File packageDir)
      {
      if (packageDir.exists() && packageDir.isDirectory())
      {
      for (final File file : packageDir.listFiles())
      {
      String fileName = file.getName();

      if (file.isDirectory())
      {
      final String nestedPackagePath = packagePath + fileName + "/";

      queue.push(new IOWork()
      {
      public void run() throws IOException
      { scanDir(nestedPackagePath, file); }

      });
      }

      if (matcher.matches(packagePath, fileName))

      { matches.add(packagePath + fileName); }

      }
      }
      }

        Attachments

          Activity

            People

            • Assignee:
              jkemnade Jochen Kemnade
              Reporter:
              dustinywoods Dustin Woods
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: