Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible classpath scanning issues by using XPathFactory.newInstance() #86

Open
dfranssen opened this issue Dec 8, 2017 · 0 comments
Open

Comments

@dfranssen
Copy link

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.

dfranssen pushed a commit to dfranssen/dxa-web-application-java that referenced this issue Dec 8, 2017
rpannekoek pushed a commit that referenced this issue Feb 2, 2018
…022 to develop

* commit 'cbf5a71ee694931dad050529ebae1ec4ff17b198':
  TSI-3022 Replaced UnknownCMD class with a simple String content holder (TSI-3010)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants