You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In pre 2.0 releases the dxa-tridion-provider is using XPathFactory.newInstance() in the XPathResolver enum to create an XPathExpression.
By using that XPathFactory.newInstance() a suitabable factory implementation will be found by scanning the classpath (cfr javadoc). This means that the classloading order could be different between restarts of Tomcat. Documentation of Tomcat 8 states that the order of loading is not anymore by alphabetical order as in previous versions but by order of which classes are requested first. This could lead to nullpointer exceptions when e.g. jstl-1.2.jar is on the classpath and has been loaded first. This is due to org.apache.taglibs.standard.tag.common.xml.JSTLXPathFactory being used as factory for which xpath.compile(sourceString) will always return null.
Furthermore the usage of ThreadLocal seems overhead as recreating the XPathExpression each time has no performance impact.
The text was updated successfully, but these errors were encountered:
dfranssen
pushed a commit
to dfranssen/dxa-web-application-java
that referenced
this issue
Dec 8, 2017
In pre 2.0 releases the dxa-tridion-provider is using
XPathFactory.newInstance()
in theXPathResolver
enum to create anXPathExpression
.By using that
XPathFactory.newInstance()
a suitabable factory implementation will be found by scanning the classpath (cfr javadoc). This means that the classloading order could be different between restarts of Tomcat. Documentation of Tomcat 8 states that the order of loading is not anymore by alphabetical order as in previous versions but by order of which classes are requested first. This could lead to nullpointer exceptions when e.g.jstl-1.2.jar
is on the classpath and has been loaded first. This is due toorg.apache.taglibs.standard.tag.common.xml.JSTLXPathFactory
being used as factory for whichxpath.compile(sourceString)
will always return null.Furthermore the usage of
ThreadLocal
seems overhead as recreating theXPathExpression
each time has no performance impact.The text was updated successfully, but these errors were encountered: