[jboss-jira] [JBoss JIRA] Commented: (JBAS-8458) Cannot use java.util.ServiceLoader in subsystem
David Lloyd (JIRA)
jira-events at lists.jboss.org
Wed Sep 22 20:29:28 EDT 2010
[ https://jira.jboss.org/browse/JBAS-8458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12552557#action_12552557 ]
David Lloyd commented on JBAS-8458:
-----------------------------------
I think the agreed-upon resolution is to change the default so that META-INF/services is exported and META-INF otherwise isn't. Filter logic needs to be revisited though. Importers can always opt to not import META-INF/services.
> 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