Bug 959478
| Summary: | Add sun.nio.cs & sun.nio.ext paths to sun.jdk module | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Brad Maxwell <bmaxwell> | ||||
| Component: | Class Loading | Assignee: | David M. Lloyd <david.lloyd> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Ladislav Thon <lthon> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 6.0.1 | CC: | cdewolf, dimitris, erhard.siegl, lcosti, lthon, rdickens | ||||
| Target Milestone: | ER6 | ||||||
| Target Release: | EAP 6.2.0 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: |
Missing packages in the `sun.jdk` module resulted in a `ServiceConfigurationError` exception being thrown when attempting to load custom character sets when using `sun.jdk`. This release of JBoss EAP 6 has added the missing packages `sun.nio.cs` and `sun.nio.cs.ext`, and as a result, custom character sets can be used with the `sun.jdk` module.
|
Story Points: | --- | ||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2013-12-15 16:55:40 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Brad Maxwell
2013-05-03 15:16:37 UTC
The simple workaround is to use the variant of ServiceLoader.load() which accepts a class loader, and pass in null. In fact this is almost always the right way to load things when you know they're part of the JDK. Created attachment 747944 [details]
Project with WAR to demonstrate the problem
In this particular case we don't want to load a class from the JDK, but we created our own charset. But JBoss includes <path name="META-INF/services"/> in modules/sun/jdk/main/module.xml. Therefore it loads META-INF/services/java.nio.charset.spi.CharsetProvider from jre/lib/charsets.jar. But then it can't find sun.nio.cs.ext.ExtendedCharsets since this path is not included in the module. So it throws an exception before it gets to the custom service. In my opinion sun/jdk/main/module.xml is not consistent. Either it should not include META-INF/services, or, if it does, it has to include the classes that are referenced in the extensions. OK that makes sense. Added dev_ack+ on behalf of David. I don't think this has been fixed correctly. Specifically, I belive that there is no such package as "sun.nio.ext" -- instead, it should have been "sun.nio.cs.ext". Moving back to assigned. On the other hand, I admit I'm not expert in this area, so I'd like to be proven wrong :-) I took the liberty to fix this myself. Here's the upstream pull request: https://github.com/wildfly/wildfly/pull/5259 Verified with EAP 6.2.0.ER6. |