Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-4

Cannot use java.util.ServiceLoader in subsystem

    XMLWordPrintable

    Details

      Description

      ServiceLoader API usage seems broken

      In ModuleXmlParser I see

      case XMLStreamConstants.END_ELEMENT: {
      final PathFilter exportFilter = filterList.isEmpty() ? PathFilters.exclude("META-INF") : PathFilters.all(filterList);
      if (file.isDirectory())

      { resourceLoader = new FileResourceLoader(identifier, file, name, exportFilter); }

      else {
      try

      { resourceLoader = new JarFileResourceLoader(identifier, new JarFile(file), name, exportFilter); }

      catch (IOException e)

      { throw new XMLStreamException("Invalid JAR file specified", reader.getLocation(), e); }

      }
      specBuilder.addResourceRoot(resourceLoader);
      return;
      }

      which generally seems to disable resource loads from META-INF. If I add this explicitly to modules.xml

      <resource-root path="jbosgi-framework-core-1.0.0.Alpha8-SNAPSHOT.jar">
      <exports>
      <include path="META-INF"/>
      </exports>
      </resource-root>

      I can load the resourceURL, but a subsequent classload of the service fails. Adding the path as well

      <resource-root path="jbosgi-framework-core-1.0.0.Alpha8-SNAPSHOT.jar">
      <exports>
      <include path="META-INF/services"/>
      <include path="org/jboss/osgi/framework/launch"/>
      </exports>
      </resource-root>

      lets that resource load fail.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  thomas.diesler Thomas Diesler
                  Reporter:
                  thomas.diesler Thomas Diesler
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: