Page 1 of 1

NullPointerException in version 3.3.6

PostPosted: Fri Oct 20, 2017 6:31 pm
by klausT
Hi,

After upgrading to version 3.3.6 I am getting the following NullPointerException:

java.lang.NullPointerException
at org.opendope.conditions.Condition.evaluate(Condition.java:159)
at org.docx4j.model.datastorage.OpenDoPEHandler.processBindingRoleIfAny(OpenDoPEHandler.java:848)
at org.docx4j.model.datastorage.OpenDoPEHandler.access$100(OpenDoPEHandler.java:83)
at org.docx4j.model.datastorage.OpenDoPEHandler$ShallowTraversor.apply(OpenDoPEHandler.java:712)
at org.docx4j.model.datastorage.OpenDoPEHandler$ShallowTraversor.walkJAXBElements(OpenDoPEHandler.java:758)
at org.docx4j.model.datastorage.OpenDoPEHandler$ShallowTraversor.walkJAXBElements(OpenDoPEHandler.java:774)
at org.docx4j.TraversalUtil.<init>(TraversalUtil.java:256)
at org.docx4j.model.datastorage.OpenDoPEHandler.preprocess(OpenDoPEHandler.java:318)


The same works fine in the previous version 3.3.5

Thanks for checking

Re: NullPointerException in version 3.3.6

PostPosted: Sat Oct 21, 2017 1:38 am
by jason
I guess it works if you set ENABLE_XPATH_CACHE to false? https://github.com/plutext/docx4j/blob/ ... r.java#L87

I guess we need to test whether val is null at https://github.com/plutext/docx4j/blob/ ... .java#L154

Re: NullPointerException in version 3.3.6

PostPosted: Mon Oct 23, 2017 5:36 am
by jason

Re: NullPointerException in version 3.3.6

PostPosted: Mon Oct 23, 2017 7:25 pm
by klausT
Changing ENABLE_XPATH_CACHE to false does the trick!

If I get it right, we will loose the performance gain introduced with version 3.3.6
Is there any chance to get both: performance improve and NO NullPointerException?

Thanks

Re: NullPointerException in version 3.3.6

PostPosted: Tue Oct 24, 2017 12:24 am
by jason
Yes, the commit linked above should give you both. I'll make a nightly build you can try if you are not building docx4j yourself?

Re: NullPointerException in version 3.3.6

PostPosted: Fri Nov 03, 2017 9:18 am
by klausT
Hi Jason,

A nightly build would be perfect.

Thanks