FasterXML / woodstox

The gold standard Stax XML API implementation. Now at Github.
Apache License 2.0
225 stars 81 forks source link

failed to parse xml: Unrecognized property `'com.ctc.wstx.maxEntityCount'` in `woodstox:6.5` #171

Closed rdulmina closed 11 months ago

rdulmina commented 1 year ago

I'm using 'com.fasterxml.woodstox:woodstox-core:6.5.0' dependency to work with XMLInputFactory via WstxInputFactory In a gradle project. When I try to run the below code,

xmlInputFactory = XMLInputFactory.newInstance();
xmlInputFactory.setProperty(WstxInputProperties.P_MAX_ENTITY_COUNT, 100000);

I'm getting failed to parse xml: Unrecognized property 'com.ctc.wstx.maxEntityCount'

I have included the woodstox dependency in my build.gradle(implementation 'com.fasterxml.woodstox:woodstox-core:6.5.0').

I have debugged my code and verified that xmlInputFactory instance is a WstxInputFactory instance.

I also tried excluding com.codehaus.woodstox like below to make sure this is not an issue of transitive dependency conflict since P_MAX_ENTITY_COUNT is not available in com.codehaus.woodstox versions.

configurations.implementation {
    exclude group: 'org.codehaus.woodstox', module: 'woodstox-core-asl'
}

Is this a bug or am I doing something wrong? It would be much appreciated if anyone can help with this. Thanx in advance.

cowtowncoder commented 1 year ago

It definitely sounds odd, and about the only guess I have is that somehow you do have an older Woodstox version: these limits were added in version 4.2.0. So I would try to double-check which version Gradle resolves, as well as whether there is any chance that a jar of an older version might be deployed somehow.

As to bug: if you could create a simple project with no external dependencies I could check, but I think that is quite unlikely.

cowtowncoder commented 11 months ago

Cannot reproduce, closing.