We are having a problem in a Data Service on WSO2 DSS 3.0.0. If I execute directly the query on the database I get no error. The database is a Sybase version 12.
DBS
<data name="DSProgram" serviceNamespace="http://myschema.org.br">
<config id="ProgramDS">
<property name="carbon_datasource_name">ProgramDS</property>
</config>
<query id="updateProgram" useConfig="ProgramDS">
<sql>update aca..program set name = :name, endingdate = (case when :endingdate = '' then null else :endingdate) where course = :course</sql>
<param name="name" sqlType="STRING"/>
<param name="endingdate" sqlType="STRING"/>
<param name="course" sqlType="INTEGER"/>
</query>
<operation name="updateProgram">
<call-query href="updateProgram">
<with-param name="name" query-param="name"/>
<with-param name="endingdate" query-param="endingdate"/>
<with-param name="course" query-param="course"/>
</call-query>
</operation>
</data>
SOAP Envelope
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:int="http://myschema.org.br">
<soapenv:Header/>
<soapenv:Body>
<int:updateProgram>
<int:name>Course name</int:name>
<int:endingdate></int:endingdate>
<int:course>999</int:course>
</int:updateProgram>
</soapenv:Body>
</soapenv:Envelope>
SOAP Fault
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault xmlns:axis2ns1820="http://ws.wso2.org/dataservice">
<faultcode>axis2ns1820:DATABASE_ERROR</faultcode>
<faultstring>DS Fault Message: Error in DS non result invoke.
DS Code: DATABASE_ERROR
Nested Exception:-
javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: DSProgram
Location: /DSProgram.dbs
Description: N/A
Default Namespace: http://myschema.org.br
Current Request Name: updateProgram
Current Params: {endingdate=, course=999, name=Course name}
Nested Exception:-
java.lang.NullPointerException</faultstring>
<detail>
<axis2ns1819:DataServiceFault xmlns:axis2ns1819="http://ws.wso2.org/dataservice">DS Fault Message: Error in DS non result invoke.
DS Code: DATABASE_ERROR
Nested Exception:-
javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: DSProgram
Location: /DSProgram.dbs
Description: N/A
Default Namespace: http://myschema.org.br
Current Request Name: updateProgram
Current Params: {endingdate=, course=999, name=Course name}
Nested Exception:-
java.lang.NullPointerException</axis2ns1819:DataServiceFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
* Data changed for confidenciality
WSO2 DSS System Log
TID[-1234] [DSS] [2015-05-12 10:51:30,156] ERROR {org.wso2.carbon.dataservices.core.engine.DataService} - DS Fault Message: Error in 'SQLQuery.processNormalQuery' DS Code: DATABASE_ERROR Source Data Service:- Name: DSProgram Location: /DSProgram.dbs Description: N/A Default Namespace: http://myschema.org.br Current Request Name: updateProgram Current Params: {endingdate=, course=999, nome=Course name} Nested Exception:- java.lang.NullPointerException org.wso2.carbon.dataservices.core.description.query.SQLQuery.processNormalQuery(SQLQuery.java:808) org.wso2.carbon.dataservices.core.description.query.SQLQuery.runQuery(SQLQuery.java:2098) org.wso2.carbon.dataservices.core.description.query.Query.execute(Query.java:252) org.wso2.carbon.dataservices.core.engine.CallQuery.executeElement(CallQuery.java:179) org.wso2.carbon.dataservices.core.engine.CallQueryGroup.executeElement(CallQueryGroup.java:111) org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89) org.wso2.carbon.dataservices.core.description.operation.Operation.execute(Operation.java:71) org.wso2.carbon.dataservices.core.engine.DataService.invoke(DataService.java:569) org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:99) org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:110) org.wso2.carbon.dataservices.core.engine.DSOMDataSource.executeInOnly(DSOMDataSource.java:80) org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processSingleRequest(SingleDataServiceRequest.java:127) org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processRequest(SingleDataServiceRequest.java:76) org.wso2.carbon.dataservices.core.dispatch.DataServiceRequest.dispatch(DataServiceRequest.java:282) org.wso2.carbon.dataservices.core.DataServiceProcessor.dispatch(DataServiceProcessor.java:39) org.wso2.carbon.dataservices.core.DBInOnlyMessageReceiver.invokeBusinessLogic(DBInOnlyMessageReceiver.java:48) org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110) org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181) org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172) org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146) org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.java:231) javax.servlet.http.HttpServlet.service(HttpServlet.java:641) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90) org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111) org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:172) org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927) org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001) org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653) java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) java.lang.Thread.run(Unknown Source)
I think you have a SQL sintax error:
<sql>update aca..program (...)</sql>
Two dots at schema.table?
Related
I am using WSO2 EI 6.3.0 version. I am creating data service within the application which reads data from CSV.
I am running into very unusual case where I have created two data services. One with sample Product.csv which is shipped with WSO2 EI.
When calling Sample (Product.CSV) I am able to get the json response message. but when I am trying to invoke another API which other data service it is giving me below error:
[2018-10-10 17:57:31,916] [EI-Core] ERROR - JsonStreamFormatter Error occurred while writing to application/json
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor133.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.wso2.carbon.integrator.core.json.JsonStreamFormatter.writeTo(JsonStreamFormatter.java:107)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.submitResponse(PassThroughHttpSender.java:597)
at org.apache.synapse.transport.passthru.PassThroughHttpSender.invoke(PassThroughHttpSender.java:281)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:45)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:337)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:158)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in CSVQuery.runQuery.
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Source Data Service:-
Name: InvoiceReport
Location: /InvoiceReport.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: _getinvoice
Current Params: {}
Nested Exception:-
DS Fault Message: Error in 'StaticOutputElement.execute', cannot find parameter with type:column name:Docnumber
DS Code: INCOMPATIBLE_PARAMETERS_ERROR
Below is Data service:
<data name="InvoiceReport" transports="http https local">
<config enableOData="false" id="CSV_InvoiceReport">
<property name="csv_datasource">/usr/lib/wso2/wso2ei/6.3.0/samples/data-services/resources/Invoice.csv</property>
<property name="csv_columnseperator">comma</property>
<property name="csv_startingrow">2</property>
<property name="csv_hasheader">true</property>
<property name="csv_headerrow">1</property>
</config>
<query id="Q2" useConfig="CSV_InvoiceReport">
<result outputType="json">{
"Products": {
"Product": [
{
"Docnumber":"$Docnumber",
"Invoicenumber":"$Invoicenumber",
"Documentdate":"$Documentdate",
"Invoiceduedate":"$Invoiceduedate",
"Customerid":"$Customerid",
"Documenttotal":"$Documenttotal",
"Quantity":"$Quantity",
"Unitprice":"$Unitprice",
"Extendedprice":"$Extendedprice",
"Consumer":"$Consumer",
"Servicename":"$Servicename"
}
]
}
}
</result>
</query>
<operation name="GetInvoiceReport">
<call-query href="Q2"/>
</operation>
<resource method="GET" path="Invoice">
<call-query href="Q2"/>
</resource>
</data>
Not sure where is the problem. Both are simple data service and didnot find any differences in creating them. One is working and one is not working at all.
Can some one please help me. Is this a bug?
Thanks in advance.
we have three querys, one select and two insert queries.
We have to execute the select query and it returns a row with four fields.
Then we have to use these four fields to excute the inserts querys.
Select query works fine, but when WSO2 ESB try to execute the next nested query fails, and show the next error
Unable to sendViaPost to url[http://6f478fba7fca:8280/services/...........SOAP12Endpoint] {org.apache.axis2.transport.http.HTTPSender
This is the xml about our data service.
<query id="updateASMCRRN" useConfig="DATABASE1_PRE">
<sql>UPDATE BOSA_ASMCRRCN SET RT_COD=:RT_COD, SET RT_DATE_DAT=to_date(:RT_DATE_DAT,'YYYY-MM-DD HH:MI:SS'), WHERE SUMMON_COD=:SUMMON_COD AND SUMREQ_SEQTMP=:SUMREQ_SEQTMP</sql>
<param name="RT_COD" sqlType="STRING"/>
<param name="RT_DATE_DAT" sqlType="STRING"/>
<param name="SUMMON_COD" sqlType="STRING"/>
<param name="SUMREQ_SEQTMP" sqlType="INTEGER"/>
</query>
......
<query id="selectNewSol" useConfig="DATABASE2_PRE">
<sql>SELECT s.NUMEROREGISTRO, to_char(s.FECHA,'YYYY-MM-DD HH:MI:SS') AS FECHA, v1.C_CLAVE_ID, v1.A_VALOR AS SUMMON_COD, v2.C_CLAVE_ID, v2.A_VALOR AS SUMREQ_SEQTMP FROM adel.ae_solicitudes s, adel.ae_valores v1, adel.ae_valores v2 WHERE s.CODFORMULARIO='1057' AND s.B_PROCESADA=1 AND s.NUMEROREGISTRO = v1.NUMEROREGISTRO AND v1.C_CLAVE_ID='.SUMMON_COD' AND s.NUMEROREGISTRO = v2.NUMEROREGISTRO AND v2.C_CLAVE_ID='.SUMREQ_SEQTMP'</sql>
<sql dialect="oracle">SELECT s.NUMEROREGISTRO, to_char(s.FECHA,'YYYY-MM-DD HH:MI:SS') AS FECHA, v1.C_CLAVE_ID, v1.A_VALOR AS SUMMON_COD, v2.C_CLAVE_ID, v2.A_VALOR AS SUMREQ_SEQTMP FROM adel.ae_solicitudes s, adel.ae_valores v1, adel.ae_valores v2 WHERE s.CODFORMULARIO='1057' AND s.B_PROCESADA=1 AND s.NUMEROREGISTRO = v1.NUMEROREGISTRO AND v1.C_CLAVE_ID='.SUMMON_COD' AND s.NUMEROREGISTRO = v2.NUMEROREGISTRO AND v2.C_CLAVE_ID='.SUMREQ_SEQTMP'</sql>
<result element="Solicitudes" rowName="Solicitud">
<element export="SUMMON_COD" name="SUMMON_COD" query-param="SUMMON_COD" xsdType="string"/>
<element export="RT_COD" name="RT_COD" query-param="NUMEROREGISTRO" xsdType="string"/>
<element export="RT_DATE_DAT" name="RT_DATE_DAT" query-param="FECHA" xsdType="string"/>
<element export="SUMREQ_SEQTMP" name="SUMREQ_SEQTMP" query-param="SUMREQ_SEQTMP" xsdType="integer"/>
<call-query href="updateASMCRRN">
<with-param name="RT_COD" query-param="NUMEROREGISTRO"/>
<with-param name="RT_DATE_DAT" query-param="FECHA"/>
<with-param name="SUMMON_COD" query-param="SUMMON_COD"/>
<with-param name="SUMREQ_SEQTMP" query-param="SUMREQ_SEQTMP"/>
</call-query>
</result>
</query>
<operation name="selectNewSol">
<call-query href="selectNewSol"/>
</operation>
Now this is the error:
ERROR {org.apache.synapse.transport.passthru.PassThroughHttpSender} - Failed to submit the response {org.apache.synapse.transport.passthru.PassThroughHttpSender}
org.apache.axis2.AxisFault: DS Fault Message: Error in 'SQLQuery.processPostNormalQuery': DS Fault Message: Error in 'SQLQuery.processPostNormalQuery': operation not allowed
DS Code: DATABASE_ERROR
Nested Exception:-
java.sql.SQLException: operation not allowed
DS Code: DATABASE_ERROR
Source Data Service:-
Name: pollingSolicitudesADEL
Location: /pollingSolicitudesADEL.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: selectNewSol
Current Params: {}
Nested Exception:-
DS Fault Message: Error in 'SQLQuery.processPostNormalQuery': operation not allowed
DS Code: DATABASE_ERROR
Nested Exception:-
java.sql.SQLException: operation not allowed
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo
Thanks in advance for any help.
I am trying to consume WSO2 admin services, specifically in the Identity Server. I want create a new tenant. I consume TenantMgtAdminService (https://127.0.0.1:9443/services/TenantMgtAdminService?wsdl), function addTenant. For consume this service I am using jaggery. This is my code:
<%
function tenant() {
var log = new Log();
var ws = require('ws');
var version = new ws.WSRequest();
var options = new Array();
options.useSOAP = 1.2;
options.useWSA = 1.0;
options.action = "urn:addTenant";
var payload = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.mgt.tenant.carbon.wso2.org" xmlns:xsd="http://beans.common.stratos.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<ser:addTenant>
<ser:tenantInfoBean>
<xsd:active>true</xsd:active>
<xsd:admin>admin</xsd:admin>
<xsd:adminPassword>admin</xsd:adminPassword>
<xsd:createdDate>2016-01-11T11:15:04-04:00</xsd:createdDate>
<xsd:email>maikelf#mymail.com</xsd:email>
<xsd:firstname>Manuel</xsd:firstname>
<xsd:lastname>Fdez</xsd:lastname>
<xsd:originatedService>mymail.com</xsd:originatedService>
<xsd:successKey>test</xsd:successKey>
<xsd:tenantDomain>mymail.com</xsd:tenantDomain>
<xsd:tenantId>4</xsd:tenantId>
<xsd:usagePlan>demo</xsd:usagePlan>
</ser:tenantInfoBean>
</ser:addTenant>
</soapenv:Body>
</soapenv:Envelope>';
var result;
try {
version.open(options, "https://127.0.0.1:9443/services/TenantMgtAdminService", false, "admin", "admin");
version.send(payload);
} catch (e) {
log.error(e.toString());
return e.toString();
}
return result;
}
print(tenant());
%>
The value of payload is taked of SOAPUI
In soapui
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.mgt.tenant.carbon.wso2.org" xmlns:xsd="http://beans.common.stratos.carbon.wso2.org/xsd">
<soapenv:Header/>
<soapenv:Body>
<ser:addTenant>
<!--Optional:-->
<ser:tenantInfoBean>
<!--Optional:-->
<xsd:active>true</xsd:active>
<!--Optional:-->
<xsd:admin>admin</xsd:admin>
<!--Optional:-->
<xsd:adminPassword>admin</xsd:adminPassword>
<!--Optional:-->
<xsd:createdDate>2016-01-11T11:15:04-04:00</xsd:createdDate>
<!--Optional:-->
<xsd:email>maikelf#mymail.com</xsd:email>
<!--Optional:-->
<xsd:firstname>Manuel</xsd:firstname>
<!--Optional:-->
<xsd:lastname>Fdez</xsd:lastname>
<!--Optional:-->
<xsd:originatedService>mymail.com</xsd:originatedService>
<!--Optional:-->
<xsd:successKey>test</xsd:successKey>
<!--Optional:-->
<xsd:tenantDomain>mymail.com</xsd:tenantDomain>
<!--Optional:-->
<xsd:tenantId>4</xsd:tenantId>
<!--Optional:-->
<xsd:usagePlan>demo</xsd:usagePlan>
</ser:tenantInfoBean>
</ser:addTenant>
</soapenv:Body>
</soapenv:Envelope>
The result that I get is this error:
JavaException: org.jaggeryjs.scriptengine.exceptions.ScriptException: Error occured while invoking the service
In Identity Server console
[2016-01-13 15:16:10,848] INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} - 'admin#carbon.super [-1234]' logged in at [2016-01-13 15:16:10, 847-0500]
[2016-01-13 15:16:17,275] INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} - 'admin#carbon.super [-1234]' logged in at [2016-01-13 15:16:17, 275-0500]
In the Jaggery console
[2016-01-13 15:28:05,052] ERROR {org.jaggeryjs.hostobjects.ws.WSRequestHostObject} - Error occured while invoking the serviceorg.apache.axis2.AxisFault: namespace mismatch require http://services.mgt.tenant.carbon.wso2.org found http://schemas.xmlsoap.org/soap/envelope/
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:367)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:413)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
at org.jaggeryjs.hostobjects.ws.WSRequestHostObject.jsFunction_send(WSRequestHostObject.java:362)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
at org.jaggeryjs.rhino.jtest.c32._c_tenant_1(/jtest//index.jag:16)
at org.jaggeryjs.rhino.jtest.c32.call(/jtest//index.jag)
at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:74)
at org.jaggeryjs.rhino.jtest.c32._c_script_0(/jtest//index.jag:24)
at org.jaggeryjs.rhino.jtest.c32.call(/jtest//index.jag)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.jaggeryjs.rhino.jtest.c32.call(/jtest//index.jag)
at org.jaggeryjs.rhino.jtest.c32.exec(/jtest//index.jag)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:577)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:280)
at org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:298)
at org.jaggeryjs.jaggery.core.JaggeryServlet.doGet(JaggeryServlet.java:24)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:690)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:477)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:369)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
at org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:172)
at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[2016-01-13 15:28:05,058] ERROR {JAGGERY.index:jag} - JavaException: org.jaggeryjs.scriptengine.exceptions.ScriptException: Error occured while invoking the service
The recommended approach to utilize admin services is to utilize the Jaggery WSStub [1].
Sample WSStub Code
<%
var ws = require('ws');
var stub = new ws.WSStub('https://localhost:9443/services/OAuth2TokenValidationService?wsdl');
var tokenValidator = stub.services['OAuth2TokenValidationService'].operations['findOAuthConsumerIfTokenIsValid'];
var validationResult = tokenValidatorrequest(accsessToken);
%>
Since the above service is an admin service, a valid user name and
password needs to be provided in order to consume the service.
Please follow the recommended approach to access admin services.
[1].http://jaggeryjs.org/documentation.jag?api=wsstub
I'm getting a cryptic error message - Wrong element order encountred at Reason
Here's a summary of what I am doing:
I’ve applied the UsernameToken security policy to the Security Token
Service.
I've added my app (http://localhost:3000/) as a trusted service.
I attempt to invoke the IssueToken operation at
https://localhost:9443/services/wso2carbon-sts.wso2carbon-stsHttpsSoap12Endpoint/
Using this message:
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1">http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue</a:Action>
<a:To s:mustUnderstand="1">https://localhost:9443/services/wso2carbon-sts.wso2carbon-stsHttpsSoap12Endpoint/</a:To>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:UsernameToken u:Id="uuid-6a13a244-dac6-42c1-84c5-cbb345b0c4c4-1">
<o:Username>user1</o:Username>
<o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</o:Password>
</o:UsernameToken>
</o:Security>
</s:Header>
<s:Body>
<trust:RequestSecurityToken xmlns:trust="http://docs.oasis-open.org/ws-sx/ws-trust/200512">
<wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
<a:EndpointReference>
<a:Address>http://localhost:3000/</a:Address>
</a:EndpointReference>
</wsp:AppliesTo>
<trust:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Bearer</trust:KeyType>
<trust:RequestType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/Issue</trust:RequestType>
<trust:TokenType>urn:oasis:names:tc:SAML:2.0:assertion</trust:TokenType>
</trust:RequestSecurityToken>
</s:Body>
</s:Envelope>
I get this error:
<html><head><title>Apache Tomcat/7.0.34 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - Wrong element order encountred at Reason</h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u>Wrong element order encountred at Reason</u></p><p><b>description</b> <u>The server encountered an internal error that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.apache.axiom.om.impl.exception.OMBuilderException: Wrong element order encountred at Reason
org.apache.axiom.soap.impl.builder.SOAP12BuilderHelper.handleEvent(SOAP12BuilderHelper.java:94)
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:429)
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:273)
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:234)
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
org.apache.axiom.om.impl.dom.NodeImpl.build(NodeImpl.java:447)
org.apache.axiom.om.impl.dom.ParentNode.getChildNodes(ParentNode.java:168)
org.apache.ws.security.util.WSSecurityUtil.findChildElement(WSSecurityUtil.java:596)
org.apache.ws.security.util.WSSecurityUtil.findWsseSecurityHeaderBlock(WSSecurityUtil.java:717)
org.apache.ws.security.message.WSSecHeader.insertSecurityHeader(WSSecHeader.java:145)
org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:406)
org.apache.rampart.MessageBuilder.build(MessageBuilder.java:61)
org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
org.apache.axis2.engine.Phase.invoke(Phase.java:313)
org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)
org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:515)
org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:433)
org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:398)
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:188)
org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.java:231)
javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/7.0.34 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.34</h3></body></html>
Any ideas on what I am doing wrong?
I am not sure about the exact error that you mentioned. But, if i just look, i could see that timestamp has been missed in the security header. However i would copy the request message that i tried out...I use this message with SOAPUI to get the SAML Assertion from the STS service.. I guess this may help you.. If you are using this message, Please consider about timestamp value.. you can change it as it is not signed.
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="true">
<wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp-1">
<wsu:Created>2014-03-04T17:53:57.033Z</wsu:Created>
<wsu:Expires>2014-03-04T17:58:57.033Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken-2">
<wsse:Username>admin</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">admin</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<wsa:To>https://localhost:9443/services/wso2carbon-sts</wsa:To>
<wsa:ReplyTo>
<wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:258de3bc-c053-4b41-93d5-5d292a896b3a</wsa:MessageID>
<wsa:Action>http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<wst:RequestSecurityToken xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust">
<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>
<wst:Lifetime>
<wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2014-03-04T17:53:56.768Z</wsu:Created>
<wsu:Expires xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2014-03-04T17:58:56.768Z</wsu:Expires>
</wst:Lifetime>
<wst:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</wst:TokenType>
<wst:KeyType>http://schemas.xmlsoap.org/ws/2005/02/trust/Bearer</wst:KeyType>
<wst:Claims xmlns:wsp="http://schemas.xmlsoap.org/ws/2005/02/trust" wsp:Dialect="http://wso2.org/claims">
<wsid:ClaimType xmlns:wsid="http://schemas.xmlsoap.org/ws/2005/05/identity" Uri="http://wso2.org/claims/emailaddress"></wsid:ClaimType>
<wsid:ClaimType xmlns:wsid="http://schemas.xmlsoap.org/ws/2005/05/identity" Uri="http://wso2.org/claims/givenname"></wsid:ClaimType>
</wst:Claims>
</wst:RequestSecurityToken>
</soapenv:Body>
</soapenv:Envelope>
I was just trying to do a simple data service connecting to HR schema on Oracle XE DB. I just wrote a simple query with operation which takes an input parameter and gets the result accordingly as per the bind data passed.
My Query looks as below
SELECT first_name,last_name,email,phone_number,hire_date,salary
FROM employees
WHERE first_name like :Bind_name
I have added a input variable Bind_name and passing it when im requesting the service.
But, when i trigger the service i see below error and couldn't find relevant help on web.
[2012-06-13 12:42:08,101] ERROR {org.wso2.carbon.dataservices.core.description.query.SQLQuery} - org.apache.commons.dbcp.DelegatingPreparedStatement cannot be cast to java.sql.CallableStatement
java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingPreparedStatement cannot be cast to java.sql.CallableStatement
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.setStringValue(SQLQuery.java:1943)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.setParamInPreparedStatement(SQLQuery.java:1411)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.createProcessedPreparedStatement(SQLQuery.java:1380)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processNormalQuery(SQLQuery.java:802)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.runQuery(SQLQuery.java:2069)
at org.wso2.carbon.dataservices.core.description.query.Query.execute(Query.java:252)
at org.wso2.carbon.dataservices.core.engine.CallQuery.execute(CallQuery.java:185)
at org.wso2.carbon.dataservices.core.engine.CallQueryGroup.execute(CallQueryGroup.java:110)
at org.wso2.carbon.dataservices.core.description.operation.Operation.execute(Operation.java:71)
at org.wso2.carbon.dataservices.core.engine.DataService.invoke(DataService.java:592)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:99)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:110)
at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691)
at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:563)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:409)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:286)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:45)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.java:199)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:164)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.wso2.carbon.server.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:154)
at org.wso2.carbon.server.TomcatServer$1.invoke(TomcatServer.java:254)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:396)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:356)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1534)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
[2012-06-13 12:42:08,106] ERROR {org.wso2.carbon.dataservices.core.engine.DataService} - DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: EmployeeService
Location: \EmployeeService.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: findByEmployeeNameLike
Current Params: {Bind_name=S%}
Nested Exception:-
java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingPreparedStatement cannot be cast to java.sql.CallableStatement
DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: EmployeeService
Location: \EmployeeService.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: findByEmployeeNameLike
Current Params: {Bind_name=S%}
Nested Exception:-
java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingPreparedStatement cannot be cast to java.sql.CallableStatement
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processNormalQuery(SQLQuery.java:844)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.runQuery(SQLQuery.java:2069)
at org.wso2.carbon.dataservices.core.description.query.Query.execute(Query.java:252)
at org.wso2.carbon.dataservices.core.engine.CallQuery.execute(CallQuery.java:185)
at org.wso2.carbon.dataservices.core.engine.CallQueryGroup.execute(CallQueryGroup.java:110)
at org.wso2.carbon.dataservices.core.description.operation.Operation.execute(Operation.java:71)
at org.wso2.carbon.dataservices.core.engine.DataService.invoke(DataService.java:592)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:99)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:110)
at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691)
at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:563)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:409)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:286)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:45)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.java:199)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:164)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.wso2.carbon.server.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:154)
at org.wso2.carbon.server.TomcatServer$1.invoke(TomcatServer.java:254)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:396)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:356)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1534)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingPreparedStatement cannot be cast to java.sql.CallableStatement
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.setStringValue(SQLQuery.java:1943)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.setParamInPreparedStatement(SQLQuery.java:1411)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.createProcessedPreparedStatement(SQLQuery.java:1380)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processNormalQuery(SQLQuery.java:802)
... 50 more
[2012-06-13 12:42:08,110] ERROR {org.apache.axis2.transport.http.CommonsHTTPTransportSender} - DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: EmployeeService
Location: \EmployeeService.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: findByEmployeeNameLike
Current Params: {Bind_name=S%}
Nested Exception:-
java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingPreparedStatement cannot be cast to java.sql.CallableStatement
org.apache.axis2.AxisFault: DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: EmployeeService
Location: \EmployeeService.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: findByEmployeeNameLike
Current Params: {Bind_name=S%}
Nested Exception:-
java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingPreparedStatement cannot be cast to java.sql.CallableStatement
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:78)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:409)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:286)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:443)
at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:45)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
at org.wso2.carbon.core.transports.CarbonServlet.doPost(CarbonServlet.java:199)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.wso2.carbon.bridge.BridgeServlet.service(BridgeServlet.java:164)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.wso2.carbon.server.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:154)
at org.wso2.carbon.server.TomcatServer$1.invoke(TomcatServer.java:254)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:396)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:356)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1534)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processNormalQuery'
DS Code: DATABASE_ERROR
Source Data Service:-
Name: EmployeeService
Location: \EmployeeService.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: findByEmployeeNameLike
Current Params: {Bind_name=S%}
Nested Exception:-
java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingPreparedStatement cannot be cast to java.sql.CallableStatement
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:105)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:110)
at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691)
at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeChildren(OMSerializerUtil.java:563)
at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:875)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:283)
at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:245)
at org.apache.axiom.om.impl.llom.OMSerializableImpl.serializeAndConsume(OMSerializableImpl.java:193)
at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:74)
... 35 more
Here find the .dbs file that I used,
<data name="DDD">
<config id="ds1">
<property name="org.wso2.ws.dataservice.driver">oracle.jdbc.driver.OracleDriver</property>
<property name="org.wso2.ws.dataservice.protocol">jdbc:oracle:thin:#localhost:1521/xe</property>
<property name="org.wso2.ws.dataservice.user">xxx</property>
<property name="org.wso2.ws.dataservice.password">xxx</property>
</config>
<query id="q1" useConfig="ds1">
<sql>select EMPLOYEENUMBER from employees where LASTNAME like :Bind_name</sql>
<result element="Entries" rowName="Entry">
<element name="EMPLOYEENUMBER" column="EMPLOYEENUMBER" xsdType="xs:string" />
</result>
<param name="Bind_name" sqlType="STRING" />
</query>
<operation name="op1">
<call-query href="q1">
<with-param name="Bind_name" query-param="Bind_name" />
</call-query>
</operation>
</data>
And the request is,
<p:op1 xmlns:p="http://ws.wso2.org/dataservice">
<!--Exactly 1 occurrence-->
<p:Bind_name>d%</p:Bind_name>
</p:op1>
It works fine as expected. Could you post your dbs file as well ?