Trying to use Saxon and jre 9 to execute any xml xpath rule that accesses an attribute causes an IllegalAccessException. The attribute value is defaulted to null.
java.lang.IllegalAccessException: class net.sourceforge.pmd.lang.ast.xpath.Attribute cannot access class com.sun.proxy.jdk.proxy2.$Proxy10 (in module jdk.proxy2) because module jdk.proxy2 does not export com.sun.proxy.jdk.proxy2 to unnamed module @59e84876
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:589)
at java.base/java.lang.reflect.Method.invoke(Method.java:556)
at net.sourceforge.pmd.lang.ast.xpath.Attribute.getValue(Attribute.java:43)
at net.sourceforge.pmd.lang.ast.xpath.saxon.AttributeNode.atomize(AttributeNode.java:50)
at net.sf.saxon.om.AxisIteratorImpl.atomize(AxisIteratorImpl.java:74)
at net.sf.saxon.expr.AxisAtomizingIterator.next(AxisAtomizingIterator.java:43)
at net.sf.saxon.expr.ItemMappingIterator.next(ItemMappingIterator.java:39)
at net.sf.saxon.expr.ItemMappingIterator.next(ItemMappingIterator.java:39)
at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:262)
at net.sf.saxon.functions.Contains.evaluateItem(Contains.java:42)
at net.sf.saxon.expr.Expression.iterate(Expression.java:370)
at net.sf.saxon.expr.Expression.effectiveBooleanValue(Expression.java:421)
at net.sf.saxon.functions.BooleanFn.effectiveBooleanValue(BooleanFn.java:179)
at net.sf.saxon.expr.FilterIterator$NonNumeric.matches(FilterIterator.java:182)
at net.sf.saxon.expr.FilterIterator.getNextMatchingItem(FilterIterator.java:65)
at net.sf.saxon.expr.FilterIterator.next(FilterIterator.java:44)
at net.sf.saxon.value.SequenceExtent.<init>(SequenceExtent.java:98)
at net.sf.saxon.sort.DocumentOrderIterator.<init>(DocumentOrderIterator.java:30)
at net.sf.saxon.sort.DocumentSorter.iterate(DocumentSorter.java:85)
at net.sf.saxon.sxpath.XPathExpression.evaluate(XPathExpression.java:98)
at net.sourceforge.pmd.lang.rule.xpath.SaxonXPathRuleQuery.evaluate(SaxonXPathRuleQuery.java:116)
at net.sourceforge.pmd.lang.rule.XPathRule.evaluate(XPathRule.java:93)
at net.sourceforge.pmd.lang.rule.XPathRule.apply(XPathRule.java:78)
at net.sourceforge.pmd.RuleSet.apply(RuleSet.java:473)
at net.sourceforge.pmd.RuleSets.apply(RuleSets.java:143)
at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:181)
After some digging I found this relevant resource. I think we may be in case 2.a : the proxy we use lives in a dynamic module, (here named jdk.proxy2) which makes it inaccessible to the unnamed package (in which the code of pmd currently lives I guess).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4