Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-11000

Property 'accessExternalDTD' is not recognized by (all) Xerces

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.17.5, 2.18.3
    • 2.17.7, 2.18.4, 2.19.0
    • camel-validator
    • None
    • Unknown
    • Regression

    Description

      When upgrading from v2.18.1 to 2.18.3, we encounter a (blocking) regression, preventing routes involving validator component to successfully start.

      Indeed, one of the recent validation-related changes is not fully compatible with all versions of Xerces. Especially when deployed on JBoss Wildlfy 10.1.0.Final

      Stack trace:

      Caused by: java.lang.IllegalStateException: org.xml.sax.SAXNotRecognizedException: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
      	at org.apache.camel.processor.validation.SchemaReader.createSchemaFactory(SchemaReader.java:181)
      	at org.apache.camel.processor.validation.SchemaReader.getSchemaFactory(SchemaReader.java:152)
      	at org.apache.camel.processor.validation.SchemaReader.createSchema(SchemaReader.java:192)
      	at org.apache.camel.processor.validation.SchemaReader.loadSchema(SchemaReader.java:84)
      	at org.apache.camel.component.validator.ValidatorEndpoint.createProducer(ValidatorEndpoint.java:119)
      	at org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:574)
      	... 78 more
      Caused by: org.xml.sax.SAXNotRecognizedException: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
      	at org.apache.xerces.jaxp.validation.XMLSchemaFactory.setProperty(XMLSchemaFactory.java:436)
      	at __redirected.__SchemaFactory.setProperty(__SchemaFactory.java:143)
      	at org.apache.camel.processor.validation.SchemaReader.createSchemaFactory(SchemaReader.java:178)
      	... 83 more
      

      In particular, in the following code:

      protected SchemaFactory createSchemaFactory() {
         ...
      	try {
      		factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
      	} catch (SAXException e) {
      		LOG.error(e.getMessage(), e);
      		throw new IllegalStateException(e);
      	} 
       
      }   
      

      Would it be possible to issue a simple warning, rather then raising an exception ?
      (>see Oracle recommandations: https://docs.oracle.com/javase/tutorial/jaxp/properties/error.html)

      Attachments

        Issue Links

          Activity

            People

              acosentino Andrea Cosentino
              bligny Bernard Ligny
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: