protected void initializeResources() throws TikaException, IOException, SAXException {
        //TODO allowed named configurations in tika config
        this.tikaConfig = new TikaConfig(tikaConfigPath);
        this.fetcherManager = FetcherManager.load(tikaConfigPath);
        //skip initialization of the emitters if emitting
        //from the pipesserver is turned off.
        if (maxForEmitBatchBytes > -1) {
            this.emitterManager = EmitterManager.load(tikaConfigPath);
        } else {
            LOG.debug("'maxForEmitBatchBytes' < 0. Not initializing emitters in PipesServer");
            this.emitterManager = null;
        }
        this.autoDetectParser = new AutoDetectParser(this.tikaConfig);
        if (((AutoDetectParser) autoDetectParser).getAutoDetectParserConfig()
                .getDigesterFactory() != null) {
            this.digester = ((AutoDetectParser) autoDetectParser).getAutoDetectParserConfig()
                    .getDigesterFactory().build();
            //override this value because we'll be digesting before parse
            ((AutoDetectParser) autoDetectParser).getAutoDetectParserConfig().getDigesterFactory()
                    .setSkipContainerDocument(true);
            //if the user hasn't configured an embedded document extractor, set up the
            // RUnpackExtractorFactory
            if (((AutoDetectParser) autoDetectParser).getAutoDetectParserConfig()
                    .getEmbeddedDocumentExtractorFactory() == null) {
                ((AutoDetectParser) autoDetectParser)
                        .getAutoDetectParserConfig().setEmbeddedDocumentExtractorFactory(
                                new RUnpackExtractorFactory());
            }
        }
        this.detector = ((AutoDetectParser) this.autoDetectParser).getDetector();
        this.rMetaParser = new RecursiveParserWrapper(autoDetectParser);
    }
returns stack trace if there was a container exception or empty string
if there was no stacktrace

@param t
@param metadataList
@return
tika-core/src/main/java/org/apache/tika/pipes/PipesServer.java