You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by "Daniel Dekany (JIRA)" <ji...@apache.org> on 2018/09/20 19:41:00 UTC

[jira] [Commented] (FREEMARKER-104) Java 11 Compatibility Problem

    [ https://issues.apache.org/jira/browse/FREEMARKER-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16622597#comment-16622597 ] 

Daniel Dekany commented on FREEMARKER-104:
------------------------------------------

The issue I'm aware of is that if you run the application on a way so that accessing internal JRE classes (such as {{sun}} classes) are denied (which can happen since Java 9), and you put XML DOM into the data-model, then once per application life you will see an error logged saying "Error instantiating xpathSupport class" with cause exception {{java.lang.NullPointerException}}, which is ugly, but otherwise benign in itself, and then later if and only if you try to issue XPath queries from a template it will fail with "Can't try to resolve the XML query key, because no XPath support is available.". The cause is that FreeMarker can't access the "shadowed" Xalan packed into the JRE anymore. The workaround is to add Apache Xalan as a dependency (or Jaxen, but that XPath implementation might behaves differently than Xalan). Certainly, we could try to use {{javax.xml.xpath}}, since Java 5, but it didn't happen yet... I will look into that, but again, you can just add Xalan, and it should work right now.

Is this the issue you are referring to?

> Java 11 Compatibility Problem
> -----------------------------
>
>                 Key: FREEMARKER-104
>                 URL: https://issues.apache.org/jira/browse/FREEMARKER-104
>             Project: Apache Freemarker
>          Issue Type: Improvement
>    Affects Versions: 2.3.28
>            Reporter: Krzysztof Dragan
>            Priority: Critical
>
> Hi all,
> I am developer from PTC company. We are working on update our system to Java 11.
> Compiling system with newest jdk we noticed problems with using of java internal xml api.
> Are you planning new release of freemarker.jar with java 11 support?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)