Hi Yitzhak,
sorry, but I can't tell whether any of the tools that you are using relies on using some specific SAXParserFactory. Unfortunately BaseX 11.9 now does, so it may be worth a try to set the property.
All BaseX launch scripts will honor JVM arguments defined in the BASEX_JVM environment variable. So you could try the following in the environment where you execute BaseX components:
On Windows:
set "BASEX_JVM=-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"
On Linux/macOS:
export BASEX_JVM="-Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"
This setting will ensure that the JDK’s built-in parser is used for components relying on the JAXP factory mechanism (including the part of BaseX affected by this issue).
Best regards,
Gunther
Gesendet: Freitag, 2. Mai 2025 um 14:14
Von: ykhabins@bellsouth.net
An: basex-talk@mailman.uni-konstanz.de
Betreff: [basex-talk] Re: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized
Hi Gunther,
>> "...Presumably there is some other SAX parser factory on your classpath, e.g. Xerces. Can you confirm this?..."
That's correct!!!
I am using BaseX for the following tasks:
- XSD 1.1 validations via Xerces-J 2.12.2
- XSLT 3.0 transformations via Saxon-HE 12.5
To do that, and following official BaseX way, their assemblies are copied to the following directory:
c:\Program Files (x86)\BaseX\lib\custom
Here is a list of Xerces jar files:
c:\Program Files (x86)\BaseX\lib\custom\icu4j-69_1.jar
c:\Program Files (x86)\BaseX\lib\custom\cupv10k-runtime.jar
c:\Program Files (x86)\BaseX\lib\custom\org.eclipse.wst.xml.xpath2.processor_1.2.1.jar
c:\Program Files (x86)\BaseX\lib\custom\xercesImpl.jar
c:\Program Files (x86)\BaseX\lib\custom\xml-apis.jar
Here is a list of Saxon jar files:
c:\Program Files (x86)\BaseX\lib\custom\lib\jline-2.14.6.jar
c:\Program Files (x86)\BaseX\lib\custom\lib\xmlresolver-5.2.2.jar
c:\Program Files (x86)\BaseX\lib\custom\lib\xmlresolver-5.2.2-data.jar
c:\Program Files (x86)\BaseX\lib\custom\saxon-he-12.5.jar
c:\Program Files (x86)\BaseX\lib\custom\saxon-he-test-12.5.jar
c:\Program Files (x86)\BaseX\lib\custom\saxon-he-xqj-12.5.jar
In such case, will it work the suggestion to tweak the SAXParserFactory setting?
And where exactly should I put that line?
javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
Regards,
Yitzhak Khabinsky