Project

Profile

Help

Support #4898

closed

Processor.setConfigurationProperty() - Deprecated

Added by Raymond Lillibridge about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
2021-02-09
Due date:
% Done:

0%

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

Description

My Java application has the following two lines of code, which are working:

DocxGeneratingOutputUriResolver outputResolver = new DocxGeneratingOutputUriResolver(outDir, templateDoc, log);

processor.setConfigurationProperty(FeatureKeys.OUTPUT_URI_RESOLVER, outputResolver);

However, using the Eclipse IDE 2020-12, I am getting this message on the usage of the Processor.setConfigurationProperty(): "Deprecated. since 9.9 - use setConfigurationProperty(Feature, Object)."

I would prefer to upgrade my application to use either of the suggested methods: Xslt30Transformer.setResultDocumentHandler(java.util.function.Function) or XsltController.setResultDocumentResolver(ResultDocumentResolver) instead.

I have found some simple examples online on how to use them, but they are such a leap from my currently deprecated methods, I haven't a clue on how to upgrade things.

Any support is kindly appreciated.

Actions #1

Updated by Michael Kay about 3 years ago

The simplest change is just to change

processor.setConfigurationProperty(FeatureKeys.OUTPUT_URI_RESOLVER, outputResolver);

to

processor.setConfigurationProperty(Feature.OUTPUT_URI_RESOLVER, outputResolver);

This has two benefits: it gives stronger type checking, and it means we don't have the overhead of matching the long supplied string against 150 candidate strings at run time.

Actions #2

Updated by Raymond Lillibridge about 3 years ago

This works when running from within the Eclipse IDE but not when using the newly generated Maven Installed jar file.

Getting this from the CMD:

Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.municode.jswpx2docx.xml2docx.MakeDocx.transformXml(MakeDocx.java:303)
        at com.municode.jswpx2docx.xml2docx.MakeDocx.handleCommandLine(MakeDocx.java:255)
        at com.municode.docbook2docx.MakeDocx.main(MakeDocx.java:21)
Caused by: java.lang.UnsupportedOperationException: No class provided, and an appropriate one cannot be found.
        at org.apache.logging.log4j.LogManager.callerClass(LogManager.java:571)
        at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:596)
        at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:583)
        at com.municode.jswpx2docx.xml2docx.generator.DocxGeneratingOutputUriResolver.<clinit>(DocxGeneratingOutputUriResolver.java:27)

Is there anything I should make sure to set in my pom.xml file for Saxon?

<!-- https://mvnrepository.com/artifact/net.sf.saxon/Saxon-HE -->
<dependency>
    <groupId>net.sf.saxon</groupId>
    <artifactId>Saxon-HE</artifactId>
    <version>10.3</version>
</dependency>
Actions #3

Updated by Raymond Lillibridge about 3 years ago

Looks like this is a logging issue.

Thank you for your kind support! (Please consider this resolved.)

Actions #4

Updated by Michael Kay about 3 years ago

  • Status changed from New to Closed
  • Assignee set to Michael Kay
  • Priority changed from High to Normal

Closed at user request.

Please register to edit this issue

Also available in: Atom PDF