私はサクソン9.7.0-14 EEとのXMLBeans-2.6.0/XMLBeansの-のxpath-2.6.0サクソン9.7とのXMLBeans/XPathの
Movement mov = (Movement) XPathUtils.executeQueryNoResultNull(message.getPayload(), "//trx:Movement [@tipo='RESTO']");
とと私のWebアプリケーションでXPathを使用しようとしています
public static XmlObject executeQueryNoResultNull(XmlObject source, String query) {
XmlObject[] results = source.selectPath(DECLARE_NS + "$this" + query);
if (results.length == 0) {
return null;
} else {
return results[0];
}
}
と私は
java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Trying XDK... Trying delegated path engine... FAILED on declare namespace trx='http://www.test.com/xxx/xx/trx';$this//trx:Movement[@tipo='RESTO']
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:185)
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:136)
at org.apache.xmlbeans.impl.store.Cursor._selectPath(Cursor.java:902)
at org.apache.xmlbeans.impl.store.Cursor.selectPath(Cursor.java:2634)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:476)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:460)
このエラーを持っているが、問題のXMLBeansのですか? Saxonだけを使用してXMLBeansを削除できますか?ここで
私module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="app-common">
<resources>
<resource-root path="jsr173_1.0_api.jar"/>
<resource-root path="resolver.jar"/>
<resource-root path="xbean_xpath.jar"/>
<resource-root path="saxon9ee.jar"/>
<resource-root path="saxon9-dom.jar"/>
<resource-root path="xmlbeans-2.6.0.jar"/>
このメッセージは、通常、Saxonクラスが見つからないことを示しています。 jarファイルが実際に必要な場所にインストールされていること、そして 'module.xml'の' path'値にあるjarファイルの名前がJARファイル内のjarファイルの実際の名前と一致することを確認することを二重チェックする価値があります。ファイルシステム。また、SaxonのバージョンとXMLBeansのドキュメントの内容が一致することを確認する必要があるかもしれません。 – sideshowbarker
JARファイルが正しいと思われ、JBossモジュールディレクトリにそれらがあります。ここではhttps://wiki.apache.org/xmlbeans/XmlBeansFaq#whatJarsを見ると、Saxon 9.7はXMLBeansからサポートされていないようです。私が間違っている ? – user817057
私のJBoss modulesディレクトリhttp://imageshack.com/a/img924/9306/K0MIpI.png – user817057