Project

Profile

Help

Bug #2411

closed

Java8 - SchemaFactoryConfigurationError: Provider for class javax.xml.validation.SchemaFactory cannot be created

Added by Jörg Godau over 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Build and release
Sprint/Milestone:
Start date:
2015-07-03
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.6
Fix Committed on Branch:
9.6
Fixed in Maintenance Release:
Platforms:

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

Actions #1

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

Actions #2

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

Actions #3

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.

Actions #4

Updated by Jörg Godau over 9 years ago

Hi O'Neil,

please send your snapshot to

Thanks

Jörg...

Actions #5

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...

Actions #6

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.

Actions #7

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...

Actions #8

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

Actions #9

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

Actions #10

Updated by O'Neil Delpratt over 9 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 80 to 100
Actions #11

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.

Actions #12

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
Actions #13

Updated by O'Neil Delpratt almost 9 years ago

  • Sprint/Milestone set to 9.6.0.7

Please register to edit this issue

Also available in: Atom PDF