Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-3974

Disabling External entity resolution when using XSL in DIH

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0, 4.1
    • Fix Version/s: None
    • Labels:
      None

      Description

      When using XSL transformation in DIH Solr tries to resolve DTD and fails when missing. This is similar to SOLR-3895 (which is solely intended to the RequestHandler).

      Sample data-config.xml:

      <entity name="sample" 
      			processor="FileListEntityProcessor" 
      			baseDir="/Volumes/data/datasets/sample" 
      			fileName="^.*\.xml$" 
      			recursive="true" 
      			rootEntity="false"
      			dataSource="null">
      			
                  <entity name="article" 
      					stream="false"
      					xsl="xslt/toDocument.xslt" 
      					processor="XPathEntityProcessor" 
      					url="${sample.fileAbsolutePath}" 
      					useSolrAddSchema="true">
      			</entity>
              </entity>
      

      Import will fail with the following error:

      Caused by: org.apache.solr.handler.dataimport.DataImportHandlerException: Exception in applying XSL Transformeation Processing Document # 1
      	at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:71)
      	at org.apache.solr.handler.dataimport.XPathEntityProcessor.initQuery(XPathEntityProcessor.java:304)
      	at org.apache.solr.handler.dataimport.XPathEntityProcessor.fetchNextRow(XPathEntityProcessor.java:224)
      	at org.apache.solr.handler.dataimport.XPathEntityProcessor.nextRow(XPathEntityProcessor.java:204)
      	at org.apache.solr.handler.dataimport.EntityProcessorWrapper.nextRow(EntityProcessorWrapper.java:243)
      	at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:472)
      	at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:498)
      	at org.apache.solr.handler.dataimport.DocBuilder.buildDocument(DocBuilder.java:411)
      	... 5 more
      Caused by: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: /opt/solr/archivearticle3.dtd (No such file or directory)
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:735)
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:336)
      	at org.apache.solr.handler.dataimport.XPathEntityProcessor.initQuery(XPathEntityProcessor.java:299)
      	... 11 more
      Caused by: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: /opt/solr/archivearticle3.dtd (No such file or directory)
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:564)
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:725)
      	... 13 more
      Caused by: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: /opt/solr/archivearticle3.dtd (No such file or directory)
      	at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:460)
      	at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:248)
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:542)
      	... 14 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gamars Stephane Gamard
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: