RE: Xpath/Saxon classpath issue?
I don't use maven and it's too hard for me to read the classpath you include, but you not only need saxon9.jar and saxon9-dom.jar, you need xbean_xpath.jar. The xbean_xpath.jar comes with the XMLBeans 2.4.0 binary distribution. And yes, it is a classpath issue. - Wing Yew _ From: Christopher Hunt [mailto:hu...@internode.on.net] Sent: Saturday, June 13, 2009 3:30 AM To: user@xmlbeans.apache.org Subject: Xpath/Saxon classpath issue? Hi there, I'm loving xmlbeans but one weird thing has held me up for a day or so now and I could do with some help. I'm using xmlbeans 2.4.0 combined with Saxon 9 to perform Xpath lookups on my document. All works well when running in the context of Eclipse and JUnit. However when I run via maven (mvn test) I get the message: java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Trying Saxon... FAILED on declare namespace gml='http://www.opengis.net/gml/3.2';declare namespace wp='http://www.classactionpl.com/gml/worldPolitical';$this/wp:World/gml:name[lower-case(text())='earth political']/../*/gml:name[lower-case(text())='australia']/../*/gml:name[lower-case(text())='new south wales']/.. ...which implies that it can't find Saxon on the classpath right? (any further elaboration on what causes this message would be appreciated). If I look at the Surefire report then here's the classpath for the test: property value=/Users/huntc/Development/Eclipse/workspace/World Political GML Model/target/classes:/Users/huntc/Development/Eclipse/workspace/World Political GML
RE: Xpath/Saxon classpath issue?
Looking at your classpath, it appears that you have inconsistent versions. I don't know where your xbean_xpath.jar is (perhaps maven uses different names, is it /Users/huntc/.m2/repository/org/apache/xmlbeans/xmlbeans-xpath/2.4.0/xmlbeans-xpath-2.4.0.jar?), but I see you have xmlbeans-2.3.0.jar and 9.1.0.6 saxon jars. A 2.3.0 xbean.jar is not going to recognize the glue code in a 2.4.0 xbean_xpath.jar, nor Saxon 9. _ From: Wing Yew Poon Sent: Monday, June 15, 2009 10:42 AM To: user@xmlbeans.apache.org Subject: RE: Xpath/Saxon classpath issue? I don't use maven and it's too hard for me to read the classpath you include, but you not only need saxon9.jar and saxon9-dom.jar, you need xbean_xpath.jar. The xbean_xpath.jar comes with the XMLBeans 2.4.0 binary distribution. And yes, it is a classpath issue. - Wing Yew _ From: Christopher Hunt [mailto:hu...@internode.on.net] Sent: Saturday, June 13, 2009 3:30 AM To: user@xmlbeans.apache.org Subject: Xpath/Saxon classpath issue? Hi there, I'm loving xmlbeans but one weird thing has held me up for a day or so now and I could do with some help. I'm using xmlbeans 2.4.0 combined with Saxon 9 to perform Xpath lookups on my document. All works well when running in the context of Eclipse and JUnit. However when I run via maven (mvn test) I get the message: java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Trying Saxon... FAILED on declare namespace gml='http://www.opengis.net/gml/3.2';declare namespace wp='http://www.classactionpl.com/gml/worldPolitical';$this/wp:World/gml:name[lower-case(text())='earth political']/../*/gml:name[lower-case(text())='australia']/../*/gml:name[lower-case(text())='new south wales']/.. ...which implies that it can't find Saxon on the classpath right? (any further elaboration on what causes this message would be appreciated). If I look at the Surefire report then here's the classpath for the test: property value=/Users/huntc/Development/Eclipse/workspace/World Political GML Model/target/classes:/Users/huntc/Development/Eclipse/workspace/World Political GML Model/target/test-classes:/Users/huntc/.m2/repository/javax/transaction/jta/1.0.1B/jta-1.0.1B.jar:/Users/huntc/.m2/repository/org/apache/xmlbeans/xmlbeans-xpath/2.4.0/xmlbeans-xpath-2.4.0.jar:/Users/huntc/.m2/repository/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar:/Users/huntc/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar:/Users/huntc/.m2/repository/net/sf/json-lib/json-lib/2.2.3/json-lib-2.2.3-jdk15.jar:/Users/huntc/.m2/repository/org/hibernate/hibernate/3.2.6.ga/hibernate-3.2.6.ga.jar:/Users/huntc/.m2/repository/org/hibernate/hibernate-commons-annotations/3.0.0.ga/hibernate-commons-annotations-3.0.0.ga.jar:/Users/huntc/.m2/repository/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar:/Users/huntc/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar:/Users/huntc/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar:/Users/huntc/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar:/Users/huntc/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar:/Users/huntc/.m2/repository/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.jar:/Users/huntc/.m2/repository/com/vividsolutions/jts/1.8/jts-1.8.jar:/Users/huntc/.m2/repository/asm/asm/1.5.3/asm-1.5.3.jar:/Users/huntc/.m2/repository/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.jar:/Users/huntc/.m2/repository/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.jar:/Users/huntc/.m2/repository/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.jar:/Users/huntc/.m2/repository/net/sf/saxon/saxon-dom/9.1.0.6/saxon-dom-9.1.0.6.jar:/Users/huntc/.m2/repository/net/sf/saxon/saxon/9.1.0.6/saxon-9.1.0.6.jar:/Users/huntc/.m2/repository/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar:/Users/huntc/.m2/repository/org/hibernate/ejb3-persistence/1.0.1.GA/ejb3-persistence-1.0.1.GA.jar:/Users/huntc/.m2/repository/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar:/Users/huntc/.m2/repository/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.jar:/Users/huntc/.m2/repository/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.jar:/Users/huntc/.m2/repository/net/sf/ehcache/ehcache/1.2.3/ehcache-1.2.3.jar:/Users/huntc/.m2/repository/org/hibernate/hibernate-annotations/3.3.1.GA/hibernate-annotations-3.3.1.GA.jar:/Users/huntc/.m2/repository/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar:/Users/huntc/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar:/Users/huntc/.m2/repository/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar:/Users/huntc/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/Users/huntc/.m2/repository/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.jar:/Users/huntc/.m2
RE: Xpath/Saxon classpath issue?
Hi Wing Yew, On 16/06/2009, at 3:42 AM, user-digest-h...@xmlbeans.apache.org wrote: I don't use maven and it's too hard for me to read the classpath you include, but you not only need saxon9.jar and saxon9-dom.jar, you need xbean_xpath.jar. The xbean_xpath.jar comes with the XMLBeans 2.4.0 binary distribution. And yes, it is a classpath issue. Thanks for your reply. I have also tried using xbean_xpath.jar but with the same result. Please note that I'm using xmlbeans- xpath-2.4.0.jar which contains the same classes as xbean_xpath.jar - I think though that xmlbeans-xpath-2.4.0.jar is provided as a convenience for us Maven users. Please note that all works well when running under jUnit and Eclipse, but not Maven and Surefire. Perhaps this is more of a Maven issue. Nonetheless, any help appreciated before I give up on using the xpath of xmlbeans. Kind regards, Christopher P.S. I find it a little bewildering that xmlbeans doesn't utilise Maven given its Apache status.
RE: Xpath/Saxon classpath issue?
P.S. I find it a little bewildering that xmlbeans doesn't utilise Maven given its Apache status. There is no law that says that Apache projects must use Maven. Ant is an Apache project too. XMLBeans has been using Ant for years, and it serves its purpose just fine. - To unsubscribe, e-mail: user-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: user-h...@xmlbeans.apache.org
RE: Xpath/Saxon classpath issue?
Hmm, Christopher, a while back, another user had a problem just like you - http://www.mail-archive.com/user@xmlbeans.apache.org/msg03687.html - everything works fine not using maven, but it doesn't work when using maven, and the problem as with your case is using incompatible versions of xbean.jar and xbean_xpath.jar (however they are renamed in maven). Seems to me maven must make it easy for users to make mistakes like that, which doesn't speak in its favor. But I speak out of ignorance, since I don't use maven. - Wing Yew _ From: Christopher Hunt [mailto:hu...@internode.on.net] Sent: Monday, June 15, 2009 4:26 PM To: Wing Yew Poon Cc: user@xmlbeans.apache.org Subject: RE: Xpath/Saxon classpath issue? Hi Wing Yew, On 16/06/2009, at 3:42 AM, HYPERLINK mailto:user-digest-h...@xmlbeans.apache.orguser-digest-h...@xmlbeans.apache.org wrote: I don't use maven and it's too hard for me to read the classpath you include, but you not only need saxon9.jar and saxon9-dom.jar, you need xbean_xpath.jar. The xbean_xpath.jar comes with the XMLBeans 2.4.0 binary distribution. And yes, it is a classpath issue. Thanks for your reply. I have also tried using xbean_xpath.jar but with the same result. Please note that I'm using xmlbeans-xpath-2.4.0.jar which contains the same classes as xbean_xpath.jar - I think though that xmlbeans-xpath-2.4.0.jar is provided as a convenience for us Maven users. Please note that all works well when running under jUnit and Eclipse, but not Maven and Surefire. Perhaps this is more of a Maven issue. Nonetheless, any help appreciated before I give up on using the xpath of xmlbeans. Kind regards, Christopher P.S. I find it a little bewildering that xmlbeans doesn't utilise Maven given its Apache status.