This discussion is archived
5 Replies Latest reply: Oct 1, 2007 6:27 PM by 666705 RSS

No query engine found

666705 Newbie
Currently Being Moderated
I've created a simple war project within a simple ear project using Workshop 9.2, and have deployed the ear to the example server. The war contains a single web service that accepts an xml string and an xquery string. The web service applies the xquery against the xml like so, using xml beans:

     public String testXml(String xml, String xq) throws XmlException
          XmlObject xmlObj = XmlObject.Factory.parse(xml);
          XmlObject[] results = xmlObj.execQuery(xq);
          StringBuffer sb = new StringBuffer();
          for (XmlObject result : results)
               sb.append(result.xmlText(new XmlOptions().setSavePrettyPrint()));
          return sb.toString();

Problem is, when I test this web service, I get the following exception. What am I doing wrong here?

java.lang.RuntimeException: No query engine found
at org.apache.xmlbeans.impl.values.XmlObjectBase.execQuery(
at org.apache.xmlbeans.impl.values.XmlObjectBase.execQuery(
at xmlbeans.TestXMLBeans.testXml(
at jrockit.reflect.VirtualNativeMethodInvoker.invoke(Ljava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
    at java.lang.reflect.Method.invoke(Ljava.lang.Object;[Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
    at weblogic.wsee.component.pojo.JavaClassComponent.invoke(
    at weblogic.wsee.handler.HandlerIterator.handleRequest(
    at weblogic.wsee.server.servlet.SoapProcessor.handlePost(
    at weblogic.wsee.server.servlet.SoapProcessor.process(
    at weblogic.wsee.server.servlet.BaseWSServlet$
    at weblogic.wsee.server.servlet.BaseWSServlet.service(
    at javax.servlet.http.HttpServlet.service(
    at weblogic.servlet.internal.StubSecurityHelper$
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(
    at weblogic.servlet.internal.ServletStubImpl.execute(
    at weblogic.servlet.internal.ServletStubImpl.execute(
    at weblogic.servlet.internal.WebAppServletContext$
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(
    at weblogic.servlet.internal.WebAppServletContext.execute(
  • 1. Re: No query engine found
    666705 Newbie
    Currently Being Moderated
    The only solution I've found is to remove the apache_xbean.jar library from ${bea_home}/weblogic92/common/bin/ and put it instead in ${domain_home}/lib/. Then I can add the saxon libraries to ${domain_home}/lib/ and everything works fine. This seems like a horrible long-term solution, but it works for now.

    Does anyone at all have further ideas, or is this board really that dead?
  • 2. Re: No query engine found
    666705 Newbie
    Currently Being Moderated
    Did you deploy the ear from within workshop or from an external build? When I deploy from within workshop, it fails because it can't find required classes (result of moving apache_xbeans.jar). As a result, I have to move apache_xbeans.jar into and out of ...common/lib to get things to work...a total pain!
  • 3. Re: No query engine found
    666705 Newbie
    Currently Being Moderated
    Tricky solution:
    Add xbean_xpath.jar (copy from XMLBean 2.2.0), saxon8.jar, saxon8-dom.jar (copy from saxon 8.6.1) to classpath inside startWebLogic.cmd or .sh.
  • 4. Re: No query engine found
    666705 Newbie
    Currently Being Moderated
    I believe this is actually the right thing to do because you need to have xbean_xpath.jar in the same classpath that XMLBeans is (if using saxon). One slight mod I would make is to add these to the POST_CLASSPATH variable in setDomainEnv.cmd/sh.

    If you're not using Saxon as the XQuery engine but are using xqrl you need to put the following jars on the classpath instead of xbean_xpath.jar:

    For the 2002 impl:

    For the 2004 impl:

    Edited by hogue at 02/26/2007 8:08 AM
  • 5. Re: No query engine found
    666705 Newbie
    Currently Being Moderated
    hi all
    i have one more soln for this problem
    I got this working by adding a element in weblogic-application.xml this one makes to load our version of xmlbeans/saxon jar from the app-inf lib folder

    Step 1.

    I copied all the jars in the app-inf lib folder

    Volume in drive C is SYSTEM
    Volume Serial Number is 7CF4-E4FE

    Directory of C:\workshop\kai\webserviceEAR\EarContent\APP-INF\lib

    0/01/2007 07:14 PM <DIR> .
    0/01/2007 07:14 PM <DIR> ..
    0/01/2007 07:13 PM 23,630 jsr173_1.0_api.jar
    0/01/2007 07:14 PM 60,047 resolver.jar
    0/01/2007 06:59 PM 12,569 saxon8-jdom.jar
    0/01/2007 06:59 PM 2,297,989 saxon8.jar
    0/01/2007 07:14 PM 2,664,574 xbean.jar
    0/01/2007 06:59 PM 5,578 xbean_xpath.jar
    0/01/2007 07:14 PM 429,483 xmlpublic.jar
    7 File(s) 5,493,870 bytes
    2 Dir(s) 2,820,255,744 bytes free
    step-2 added this entry into the weblogic-application.xml
    here I ran into another problem deployment discriptor did not identify the entry prefer-application-package

    I had to modify the first line of the weblogic-application.xml
    <wls:weblogic-application xmlns:xsi="" xmlns:wls="" xsi:schemaLocation="">

    ie On my end, I modfied weblogic-application.xml file by removing these 2 schema locations from the opening tag:

    After that I ran the service and see the xquery working fine the basic logic here is we made the jar files from the application to load using the tag prefer-application-packages