Project

Profile

Help

Embedding Saxon-PE in NiFi processor

Added by Hans Hübner almost 4 years ago

Hi,

in a project, I would like to use Saxon-PE inside of a NiFi processor. NiFi processors are extension modules for Apache NiFi, they are build into "NAR" bundles containing all their dependencies similar to WAR files. My processor currently fails with the following error message:

2021-01-27 07:26:40,131 ERROR [NiFi logging handler] org.apache.nifi.StdErr XPST0017 Cannot find a 2-argument function named Q{java:java.net.URLDecoder}decode(). 2021-01-27 07:26:40,131 ERROR [NiFi logging handler] org.apache.nifi.StdErr Reflexive calls to Java methods are not available under Saxon-HE

Can this be caused by Saxon-PE not finding its license file, making it fallback to being Saxon-HE, or is this message indicative of the wrong Saxon JAR being used?

I tried placing the license file in various locations of the NAR file, but that failed to solve the problem.

Any help with this would be appreciated.

Thanks, Hans


Replies (2)

RE: Embedding Saxon-PE in NiFi processor - Added by Michael Kay almost 4 years ago

It could be that you've loaded the Saxon-HE JAR file, or it could be that Saxon-PE is falling back to HE mode, which happens if either (a) you instantiate it incorrectly (e.g. calling new Processor(false)) or (b) it can't find a license file.

Try first to find out what kind of Configuration class has been instantiated: it should be a ProfessionalConfiguration. (You'll find the Configuration wrapped by the JAXP TransformerFactory or the s9api Processor).

Try to force-load the license file (rather than allowing fallback behaviour) by calling configuration.isLicensedFeature(LicenseFeature.PROFESSIONAL_EDITION).

If you can't find a way of getting the classpath search for the license file to work, consider supplying the location explicitly using configuration.setFeature(Feature.LICENSE_FILE_LOCATION).

Also a reminder: you're probably more concerned at the moment with getting this working than with managing license compliance, but do remember that it is your responsibility to ensure that individual licenses must only be deployed on a single computer (or more strictly, that you have purchased enough licenses to cover all the machines on which the software is deployed.)

RE: Embedding Saxon-PE in NiFi processor - Added by Hans Hübner almost 4 years ago

Hi Michael,

thank you for helping. It was in fact the case that the Processor constructor was invoked with false as argument, causing Saxon to operate in unlicensed mode. I changed that to true and now the PE feature that I need works.

I am aware of the single-machine nature of the license and we're going to get another once we deploy to our server system (I'm the only developer in the project at this point).

-Hans

    (1-2/2)

    Please register to reply