Forum Discussion

Peeeetertje's avatar
5 years ago

XQuery assertions are broken with SoapUI 5.6.0

Hi all,

 

Since SoapUI release 5.6.0 it seems like the XQuery assertions are broken. The following error is displayed.

 

XQuery Match Assertion failed for path [  { for $z in //item order by $z/id return  {data($z/price/text())}  }  ] : RuntimeException:java.lang.NoSuchMethodException: org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery. (java.lang.String,java.lang.String,java.lang.Integer,org.apache.xmlbeans.XmlOptions)

 

 

Steps to reproduce

  • Ensure the SoapUI releases are installed 5.5.0 and 5.6.0 including the example projects.
  • In SoapUI 5.5.0 open the example project named Sample SOAP Project Core
  • Select the following testcase Expanded TestSuite - More Than Less Than TestCase
  • Start the ServiceSoapBinding MockService
  • Run the testcase and verify the run was successful.
  • Open the request named Test Request - search in the testcase.
  • Add a XQuery Match assertion with the following XQuery expression:

 

<Result>
{
for $z in //item
order by $z/id
return <price>{data($z/price/text())}</price>
}
</Result>

 

  • Click the Select from current button and verify the following expected result is displayed:

 

<Result>
  <price>1</price>
  <price>1.99</price>
  <price>2.99</price>
  <price>4.99</price>
  <price>349</price>
</Result>

 

  • Click the Test button and verify the popup message shows it is Successful
  • Save the project
  • Redo the steps listed above (except the installation step) with SoapUI 5.6.0
  • Verify the testcase will fail on the XQuery assertion with the Error message listed above.

Environment used:

MacOS Cataline (10.15.7)

  • Vienna20's avatar
    Vienna20
    New Contributor

    Hello Peeeetertje ,

    I examined the classpath and noticed, that there are two versions of org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery, one with 3-paramters constructor in xmlbeans-xpath-2.6.0.jar and one with a 4-parameters constructor in xmlbeans-3.1.1-sb-fixed.jar.

    According to the exception the latter one is intended to be used, while the first one comes first in the classpath.

    It seems to me that xmlbeans-xpath-2.6.0.jar was accidentially packed into SoapUI 5.6.0 by SmartBear. There is only a single second class org.apache.xmlbeans.impl.xpath.saxon.XBeansXPath in that jar, but this seems to be identical to the version in xmlbeans-3.1.1-sb-fixed.jar.

    My solution (macOS):

    • Rename xmlbeans-xpath-2.6.0.jar to xmlbeans-xpath-2.6.0.txt in /Applications/SoapUI-5.6.0.app/Contents/java/app/lib/.

    Works for me, no further sideeffects noticed so far.

    cheers

    kacperwniczykfyi

    • pmerikan's avatar
      pmerikan
      Occasional Visitor

      I can confirm that Vienna20 workaround really works (remove the file xmlbeans-xpath-2.6.0.jar). It's been bugging me for a long time. I'm really surprised that Smartbear has not fixed it and released an updated version.

      • Vienna20's avatar
        Vienna20
        New Contributor

        Hello pmerikan ,

        thank you for your Kudo!

        Actually someone having a support contract (a SoapUI license) could file a support request.

        I don't have one.

        Therefore I filed a bug on GitHub: https://github.com/SmartBear/soapui/issues/581

        GitHub is not a replace for official support, but let's see what happens. 🙂

        I doubt if Smartbear staff members are looking for bugs here in this forum.

        cheers,
        Harald

  • Hi, I'm encountering very similar problem with XPath on SoapUI 5.6.0. Test projects that are working on version 5.5.0 are getting exception: 

    RuntimeException:java.lang.NoSuchMethodException: org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery.<init>(java.lang.String,java.lang.String,java.lang.Integer,org.apache.xmlbeans.XmlOptions)

     

    Environment which I'm using is Linux Alpine with Java 12

    • ZDGN's avatar
      ZDGN
      Contributor

      Hi guys,

       

      Sorry to tell you it works fine on SoapUI 5.6.0 on Windows 10.

       

      Can you just have a look at the saxon jar files ?
      On my side, the lib folder contains:

      • saxon-9.1.0.8j.jar
      • saxon-9.jar
      • saxon-dom-9.1.0.8j.jar

      May be it's just a matter of version.