Bug #2411
closedJava8 - SchemaFactoryConfigurationError: Provider for class javax.xml.validation.SchemaFactory cannot be created
100%
Description
under Java8 we're getting the error:
@javax.xml.validation.SchemaFactoryConfigurationError: Provider for class javax.xml.validation.SchemaFactory cannot be created
at javax.xml.validation.SchemaFactoryFinder.findServiceProvider(SchemaFactoryFinder.java:414)
...
Caused by: java.util.ServiceConfigurationError: javax.xml.validation.SchemaFactory: Provider com.saxonica.jaxp.SchemaFactoryImpl not found
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
...@
This is caused by the file:
@ /META-INF/services/javax.xml.validation.SchemaFactory@
with content:
@ com.saxonica.jaxp.SchemaFactoryImpl@
Either this file should be removed or the content should be changed to
@ com.saxonica.ee.jaxp.SchemaFactoryImpl@
Please correct this error.
Regards
J.Godau
Schütze Consulting AG
Updated by O'Neil Delpratt over 9 years ago
- Category set to Build and release
- Status changed from New to In Progress
- Assignee set to O'Neil Delpratt
- % Done changed from 0 to 80
- Found in version changed from Saxon-EE 9.6.0-5 to 9.6
Thanks for reporting this issue which is a bug in the build file. A patch has been committed.
TODO: Create a test case to prevent such errors happening again
Updated by Jörg Godau over 9 years ago
Hi O'Neil,
thanks for the quick update - is it possible to get a Version with the fix (even just a Release Candidate or Snapshot build) so that we can progress with our project?
Cheers
Jörg Godau
Schütze Consulting AG
Updated by O'Neil Delpratt over 9 years ago
Hi Jörg,
Yes I think we can send your a snapshot privately for you to test.
Updated by Jörg Godau over 9 years ago
Updated by Jörg Godau over 9 years ago
Hi O'Neil,
the original problem is fixed in the snapshot you sent us, but there is a new problem.
We need to deactivate the secure Processing, as we are dealing with files with over 10000 (tenthousand) elements. We do that with:
@final SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
schemaFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);@
This causes:
@ org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
at javax.xml.validation.SchemaFactory.setFeature(SchemaFactory.java:390)@
Can Saxon deal with such large files? Do we just not need to set the flag? Or is there something we're not understanding?
Cheers
Jörg...
Updated by Michael Kay over 9 years ago
We should probably treat this as a bug, since the Javadoc does say that all implementations are expected to recognize this feature (and by implication, recognize a request to switch it off). But your application should work fine, I think, if you just avoid this call, or ignore the exception if it fails. There's a possibility that the underlying parser might impose size limits on the XML, but we've validated gigabyte-sized files without hitting any limits, so I would be surprised.
Updated by Jörg Godau over 9 years ago
Hi Michael,
we'll avoid setting the flag for now, but long term would like to have it active - in case we switch to a differnt implementation, will you open another ticket for this? If so please let us know the ticket number and we can note it in our documentation.
Many thanks for the fast responses!
Cheers
Jörg...
Updated by O'Neil Delpratt over 9 years ago
Hi,
I have created the following new bug issue #2414 to keep track of the separate problem reported in comment 5
Updated by O'Neil Delpratt over 9 years ago
Marking this bug as resolved. I have created an internal bug issue to keep track of requirement for post build test case. #2432
Updated by O'Neil Delpratt over 9 years ago
- Status changed from In Progress to Resolved
- % Done changed from 80 to 100
Updated by O'Neil Delpratt over 9 years ago
- Status changed from Resolved to Closed
- Fixed in version set to 9.6.0.7
Bug fix applied in the Saxon 9.6.0.7 maintenance release.
Updated by O'Neil Delpratt almost 9 years ago
- Applies to branch 9.6 added
- Fix Committed on Branch 9.6 added
- Fixed in Maintenance Release 9.6.0.7 added
Please register to edit this issue