Forum Discussion

BA_Service_Haus's avatar
BA_Service_Haus
Regular Contributor
14 years ago

Mock-Service with Groovy/xquery on Weblogic

I'm experiencing problems with soapUI and weblogic:
Mock-Service created in soapUI 3.6.1 and soapUI Pro 3.6.2-SNAPSHOT (with groovy scripts and xquery expressions for dispatching requests) - works fine in soapui and tomcat. But when I deploy the war file on a Weblogic server 10.3.4.0, the service operations, which are dispatched with groovy or xquery, do not work - I'm getting exceptions in the server console (see the exception log at the end).
It's queer, the responses dispatched as sequence or random work fine.

Any ideas? I have tried to declare saxon parser as preferred parser on weblogic, but it did not work.

Here is my groovy script:

def holder = new com.eviware.soapui.support.XmlHolder( mockRequest.requestContent )
holder.namespaces["per"] = "http://myserver.tld/wsdl/basis/stammdaten/personmessages_v_2_1"
holder.namespaces["soapenv"] = "http://schemas.xmlsoap.org/soap/envelope/";
def reqValue = holder["//per:KundePostadresseRequest"]
log.info reqValue.toString()
if(reqValue=="3"){
return "Response 1"
}else{
return "Response 2"
}


SOAP-Request:

<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:per="http://myserver.tld/wsdl/basis/stammdaten/personmessages_v_2_1">
<soapenv:Header/>
<soapenv:Body>
<per:KundePostadresseRequest>3</per:KundePostadresseRequest>
</soapenv:Body>
</soapenv:Envelope>


SOAP-Response is a SOAP-Fault, expected SOAP-Response is some data

Exception log:

16:10:58,177 INFO [WsdlMockRunner] Mounted WSDL for interface [PersonServiceBinding] at [/personservice?WSDL]
16:11:46,600 ERROR [SoapUI] An error occured [ Trying XBeans path engine... Trying XQRL... Trying delegated path engine... FAILED on declare namespace per='http://myserver.tld/wsdl/basis/stammdaten/personmessages_v_2_1';
//per:KundePostadresseRequest], see error log for details
java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Trying delegated path engine... FAILED on declare namespace per='http://myserver.tld/wsdl/basis/stammdaten/personmessages_v_2_1';
//per:KundePostadresseRequest
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:173)
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:130)
at org.apache.xmlbeans.impl.store.Cursor._selectPath(Cursor.java:902)
at org.apache.xmlbeans.impl.store.Cursor._selectPath(Cursor.java:894)
at org.apache.xmlbeans.impl.store.Cursor.selectPath(Cursor.java:2616)
at com.eviware.soapui.support.xml.XmlUtils.selectDomNodes(XmlUtils.java:1281)
at com.eviware.soapui.support.xml.XmlUtils.selectNodeValues(XmlUtils.java:1243)
at com.eviware.soapui.support.XmlHolder.getNodeValues(XmlHolder.java:98)
at com.eviware.soapui.support.XmlHolder.get(XmlHolder.java:223)
at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1523)
at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3311)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:161)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.getAt(DefaultGroovyMethods.java:182)
at org.codehaus.groovy.runtime.dgm$230.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:270)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at Script1.run(Script1.groovy:5)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.impl.wsdl.mock.dispatch.ScriptMockOperationDispatcher.selectMockResponse(ScriptMockOperationDispatcher.java:87
)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockOperation.dispatchRequest(WsdlMockOperation.java:247)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:301)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:385)
at com.eviware.soapui.mockaswar.MockAsWarServlet$MockServletSoapUICore.dispatchRequest(MockAsWarServlet.java:235)
at com.eviware.soapui.mockaswar.MockAsWarServlet.service(MockAsWarServlet.java:172)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
16:11:46,631 ERROR [SoapUI] An error occured [ Trying XBeans path engine... Trying XQRL... Trying delegated path engine... FAILED on declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
//faultcode], see error log for details
java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Trying delegated path engine... FAILED on declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
//faultcode
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:173)
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:130)
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)
at com.eviware.soapui.support.xml.XmlUtils.setXPathContent(XmlUtils.java:899)
at com.eviware.soapui.impl.wsdl.support.soap.SoapMessageBuilder.buildFault(SoapMessageBuilder.java:103)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:307)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:385)
at com.eviware.soapui.mockaswar.MockAsWarServlet$MockServletSoapUICore.dispatchRequest(MockAsWarServlet.java:235)
at com.eviware.soapui.mockaswar.MockAsWarServlet.service(MockAsWarServlet.java:172)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
16:11:46,631 ERROR [SoapUI] An error occured [ Trying XBeans path engine... Trying XQRL... Trying delegated path engine... FAILED on declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
//faultstring], see error log for details
java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Trying delegated path engine... FAILED on declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
//faultstring
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:173)
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:130)
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)
at com.eviware.soapui.support.xml.XmlUtils.setXPathContent(XmlUtils.java:899)
at com.eviware.soapui.impl.wsdl.support.soap.SoapMessageBuilder.buildFault(SoapMessageBuilder.java:104)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchPostRequest(WsdlMockRunner.java:307)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.dispatchRequest(WsdlMockRunner.java:385)
at com.eviware.soapui.mockaswar.MockAsWarServlet$MockServletSoapUICore.dispatchRequest(MockAsWarServlet.java:235)
at com.eviware.soapui.mockaswar.MockAsWarServlet.service(MockAsWarServlet.java:172)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3717)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)


weblogic.xml-file (needed to tell weblogic to extract the war-file on the file system):

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://www.bea.com/ns/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<wls:weblogic-version>10.3</wls:weblogic-version>
<container-descriptor>
<show-archived-real-path-enabled>true</show-archived-real-path-enabled>
</container-descriptor>
</wls:weblogic-web-app>
No RepliesBe the first to reply