[jboss-jira] [JBoss JIRA] Created: (JBAS-8458) Cannot use java.util.ServiceLoader in subsystem

Thomas Diesler (JIRA) jira-events at lists.jboss.org
Wed Sep 22 09:05:28 EDT 2010


Cannot use java.util.ServiceLoader in subsystem
-----------------------------------------------

                 Key: JBAS-8458
                 URL: https://jira.jboss.org/browse/JBAS-8458
             Project: JBoss Application Server
          Issue Type: Bug
      Security Level: Public (Everyone can see)
            Reporter: Thomas Diesler
             Fix For: 7.0.0.M1


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.
 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list