Fixed a potential XPath bug in JavaResource