Hi,
I have a proxy service which I have attached with the mail which makes
several one call to the salesforce api using the salesforce connector and
two calls to the google spreadsheet api using the google-spreadsheet
connector in each iteration. When the number of rows I call (or the number
of iterations) increase beyond 35 the proxy service starts throwing the
following two exceptions:
*[2015-12-07 11:22:03,785] ERROR - RelayUtils Error while building
Passthrough stream *
*org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException:
DOCTYPE is not allowed *
* at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
*
* at
org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:109)
*
* at
org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:570)
*
* at
org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:566)
*
* at
org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:149)
*
* at
org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:133)
*
* at
org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:98)
*
* at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:400)
*
* at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172)
*
* at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) *
* at
org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:247)
*
* at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
*
* 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) *
*Caused by: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed *
* at
org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:36)
*
* at
org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
*
* at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
*
* ... 14 more *
And
*[2015-12-07 11:22:04,040] ERROR - RelayUtils Error while building
Passthrough stream *
*org.apache.axiom.om.OMException:
com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'I'
(code 73) in prolog; expected '<' *
*at [row,col {unknown-source}]: [1,1] *
* at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
*
* at
org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:109)
*
* at
org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:570)
*
* at
org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:566)
*
* at
org.apache.synapse.transport.passthru.util.DeferredMessageBuilder.getDocument(DeferredMessageBuilder.java:149)
*
* at
org.apache.synapse.transport.passthru.util.RelayUtils.builldMessage(RelayUtils.java:133)
*
* at
org.apache.synapse.transport.passthru.util.RelayUtils.buildMessage(RelayUtils.java:98)
*
* at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:400)
*
* at
org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:172)
*
* at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180) *
* at
org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:247)
*
* at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
*
* 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) *
*Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected
character 'I' (code 73) in prolog; expected '<' *
*at [row,col {unknown-source}]: [1,1] *
* at
com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:639) *
* at
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2052)
*
* at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1134) *
* at
org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
*
* at
org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:34)
*
* at
org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:681)
*
* at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
*
* ... 14 more *
I have tried the following which do not seem to work in this case:
- Redeclare the properties inside the proxy service so that any problem
because of the properties being out of context inside the proxy is resolved.
- Increase the http.socket.timeout in the
wso2esb-4.9.0/repository/conf/passthru-http.properties file to a quite
large value
- Increase the synapse.global_timeout_interval in
wso2esb-4.9.0/repository/conf/synapse.properties to 600000.
- Run the two iterations in the proxies separately which made it
possible to run up to 150 rows without any exceptions.
The exceptions sometimes seem to reduce when http.socket.timeout was
increased, but still continue to appear.
What could be done to resolve this issue? Please help.
Thank you,
Riyafa
--
Riyafa Abdul Hameed
Software Engineering intern, WSO2
Email: [email protected]
Website: https://riyafa.wordpress.com/ <http://riyafa.wordpress.com/>
<http://facebook.com/riyafa.ahf> <http://lk.linkedin.com/in/riyafa>
<http://twitter.com/Riyafa1>
<?xml version="1.0" encoding="UTF-8"?>
<proxy name="InvoiceChartProxy" startOnLoad="true" trace="disable"
transports="http https" xmlns="http://ws.apache.org/ns/synapse">
<target>
<inSequence>
<!-- The acceess token -->
<property expression="json-eval($.accesstoken)"
name="accesstoken1" scope="default" type="STRING"/>
<!-- The key of the spreadsheet -->
<property expression="json-eval($.key)" name="sheetKey1"
scope="default" type="STRING"/>
<!-- The id of the worksheet in the spreadsheet -->
<property expression="json-eval($.workSheetId)" name="sheetId1"
scope="default" type="STRING"/>
<!-- The starting row number -->
<property expression="json-eval($.rowNum)" name="rowNum1"
scope="default" type="STRING"/>
<!-- The last row number in the sheet -->
<property expression="json-eval($.numRows)" name="rowss1"
scope="default" type="STRING"/>
<!-- The column number of the project -->
<property expression="json-eval($.colNumKey)"
name="retrieveColNum1" scope="default" type="STRING"/>
<!-- The column number of the column to be updated -->
<property expression="json-eval($.colNumUpdate)"
name="updateColNum1" scope="default" type="STRING"/>
<property name="messageType" scope="axis2" type="STRING" value="application/json"/>
<!-- initialize the connector -->
<salesforce.init configKey="salesforceLogin"/>
<!-- fetch the key column -->
<googlespreadsheet.init>
<accessToken>{$ctx:accesstoken1}</accessToken>
</googlespreadsheet.init>
<googlespreadsheet.fetchSpecificRowsOrColumns>
<key>{$ctx:sheetKey1}</key>
<worksheetId>{$ctx:sheetId1}</worksheetId>
<minRow>{$ctx:rowNum1}</minRow>
<maxRow>{$ctx:rowss1}</maxRow>
<minCol>{$ctx:retrieveColNum1}</minCol>
<maxCol>{$ctx:retrieveColNum1}</maxCol>
</googlespreadsheet.fetchSpecificRowsOrColumns>
<!-- Iterate through the cells in the column -->
<iterate description="" expression="//abc:entry" id="iterator1" xmlns:abc="http://www.w3.org/2005/Atom">
<target>
<sequence>
<property expression="get-property('updateColNum1')"
name="updateColNum" scope="default" type="STRING"/>
<!-- Get the row number and the update cell Id -->
<property expression="//gs:cell/@row" name="rowNum"
scope="default" type="STRING" xmlns:gs="http://schemas.google.com/spreadsheets/2006"/>
<property
expression="fn:concat('R', get-property('rowNum'), 'C',get-property('updateColNum'))"
name="updateCellId" scope="default" type="STRING"/>
<script language="js"><![CDATA[var key = mc.getPayloadXML()..*::content.toString();
key=key.split("-")[0];
mc.setProperty("projKey",key);]]></script>
<!-- The query -->
<property
expression="fn:concat("SELECT CreatedDate,Invoice_Number__c FROM Line_Item__c WHERE Support_Account_ID__c ='", get-property('projKey'), "' ORDER BY Invoice_Number__c ASC NULLS LAST limit 1")"
name="query1" scope="default" type="STRING"/>
<salesforce.query>
<batchSize>1</batchSize>
<queryString>{$ctx:query1}</queryString>
</salesforce.query>
<!-- Get invoice number and decide on invoice from -->
<script language="js"><![CDATA[var date=mc.getPayloadXML()..*::CreatedDate.toString();
var invoiceNumber=mc.getPayloadXML()..*::Invoice_Number__c.toString()
date=date.substring(0, 4);
date=parseInt(date, 10);
var invoiceVal;
if(date>=2015){
invoiceVal=invoiceNumber.substring(4, 7);
invoiceVal=parseInt(invoiceVal, 10);
if(invoiceVal<300){ //2015001 to 2015299
mc.setProperty("invoiceFrom", "LK");
}else if(invoiceVal<600){//2015300 to 2015599
mc.setProperty("invoiceFrom", "UK");
}else if(invoiceVal<1000){// 2015600 to ......
mc.setProperty("invoiceFrom", "Inc");
}else{
mc.setProperty("invoiceFrom", "No Invoice Number");
}
}else if(date<2015){
invoiceVal=invoiceNumber.substring(2, 4);
invoiceVal=parseInt(invoiceVal, 10);
if(invoiceNumber.length>6){
mc.setProperty("invoiceFrom", "Inc");
}else if(invoiceVal<30){
mc.setProperty("invoiceFrom", "LK");
}else if(invoiceVal<60){
mc.setProperty("invoiceFrom", "UK");
}else if(invoiceVal<100){
mc.setProperty("invoiceFrom", "Inc");
}else{
mc.setProperty("invoiceFrom", "No Invoice Number");
}
}else{
mc.setProperty("invoiceFrom", "No records found");
}]]></script>
<property expression="get-property('accesstoken1')"
name="accesstoken" scope="default" type="STRING"/>
<property expression="get-property('sheetKey1')"
name="sheetKey" scope="default" type="STRING"/>
<property expression="get-property('sheetId1')"
name="sheetId" scope="default" type="STRING"/>
<property expression="get-property('updateCellId')"
name="cellId" scope="default" type="STRING"/>
<googlespreadsheet.init>
<accessToken>{$ctx:accesstoken}</accessToken>
</googlespreadsheet.init>
<googlespreadsheet.getCell>
<key>{$ctx:sheetKey}</key>
<worksheetId>{$ctx:sheetId}</worksheetId>
<cellId>{$ctx:updateCellId}</cellId>
</googlespreadsheet.getCell>
<property expression="//abc:entry/abc:link[2]/@href"
name="cellRef" scope="default" type="STRING"/>
<script language="js"><![CDATA[var cellRef=mc.getProperty("cellRef");
var x=cellRef.split("/");
var n=x.length-1;
cellRef=x[n];
mc.setProperty("cellVersion",cellRef)]]></script>
<!-- <log level="custom">
<property expression="get-property('rowNum')" name="row1"/>
<property expression="get-property('updateColNum1')" name="col1"/>
<property expression="get-property('invoiceFrom')" name="inputValue1"/>
<property expression="get-property('updateCellId')" name="cellId1"/>
<property expression="get-property('cellVersion')" name="cellV1"/>
<property expression="get-property('sheetKey1')" name="key1"/>
<property expression="get-property('sheetId1')" name="id1"/>
<property expression="get-property('accesstoken1')" name="accesstoken2"/>
</log> -->
<log level="full"/>
<property expression="get-property('rowNum')" name="row"
scope="default" type="STRING"/>
<property expression="get-property('updateColNum1')"
name="col" scope="default" type="STRING"/>
<property expression="get-property('invoiceFrom')"
name="inputValue" scope="default" type="STRING"/>
<property expression="get-property('updateCellId')"
name="cellId" scope="default" type="STRING"/>
<property expression="get-property('cellVersion')"
name="cellV" scope="default" type="STRING"/>
<property expression="get-property('sheetKey1')" name="key"
scope="default" type="STRING"/>
<property expression="get-property('sheetId1')" name="id"
scope="default" type="STRING"/>
<property expression="get-property('accesstoken1')"
name="accesstoken" scope="default" type="STRING"/>
<googlespreadsheet.init>
<accessToken>{$ctx:accesstoken}</accessToken>
</googlespreadsheet.init>
<googlespreadsheet.updateCells>
<key>{$ctx:key}</key>
<worksheetId>{$ctx:id}</worksheetId>
<cellId>{$ctx:cellId}</cellId>
<inputValue>{$ctx:inputValue}</inputValue>
<row>{$ctx:row}</row>
<col>{$ctx:col}</col>
<cellVersion>{$ctx:cellV}</cellVersion>
</googlespreadsheet.updateCells>
</sequence>
</target>
</iterate>
<!-- ITERATION 2 -->
<!-- fetch the proj column -->
<script language="js"><![CDATA[var x=parseInt(mc.getProperty("retrieveColNum1"),10)-1;
mc.setProperty("retrieveColNum1",x+"");]]></script>
<googlespreadsheet.init>
<accessToken>{$ctx:accesstoken1}</accessToken>
</googlespreadsheet.init>
<googlespreadsheet.fetchSpecificRowsOrColumns>
<key>{$ctx:sheetKey1}</key>
<worksheetId>{$ctx:sheetId1}</worksheetId>
<minRow>{$ctx:rowNum1}</minRow>
<maxRow>{$ctx:rowss1}</maxRow>
<minCol>{$ctx:retrieveColNum1}</minCol>
<maxCol>{$ctx:retrieveColNum1}</maxCol>
</googlespreadsheet.fetchSpecificRowsOrColumns>
<!-- Iterate through the cells in the project column -->
<iterate description="" expression="//abc:entry" id="iterator2" xmlns:abc="http://www.w3.org/2005/Atom">
<target>
<sequence>
<property expression="get-property('updateColNum1')"
name="updateColNum" scope="default" type="STRING"/>
<script language="js"><![CDATA[var str = mc.getPayloadXML()..*::content.toString();
var suffix="Evaluation Support";
if(str.indexOf(suffix, str.length - suffix.length)!== -1){
mc.setProperty("invoice", "Complementary");
}]]></script>
<filter regex=".*Complementary" source="get-property('invoice')">
<then>
<property expression="//gs:cell/@row" name="rowNum"
scope="default" type="STRING" xmlns:gs="http://schemas.google.com/spreadsheets/2006"/>
<property
expression="fn:concat('R', get-property('rowNum'), 'C',get-property('updateColNum'))"
name="updateCellId" scope="default" type="STRING"/>
<property expression="get-property('accesstoken1')"
name="accesstoken" scope="default" type="STRING"/>
<property expression="get-property('sheetKey1')"
name="sheetKey" scope="default" type="STRING"/>
<property expression="get-property('sheetId1')"
name="sheetId" scope="default" type="STRING"/>
<property expression="get-property('updateCellId')"
name="cellId" scope="default" type="STRING"/>
<googlespreadsheet.init>
<accessToken>{$ctx:accesstoken}</accessToken>
</googlespreadsheet.init>
<googlespreadsheet.getCell>
<key>{$ctx:sheetKey}</key>
<worksheetId>{$ctx:sheetId}</worksheetId>
<cellId>{$ctx:updateCellId}</cellId>
</googlespreadsheet.getCell>
<property expression="//abc:entry/abc:link[2]/@href"
name="cellRef" scope="default" type="STRING"/>
<script language="js"><![CDATA[var cellRef=mc.getProperty("cellRef");
var x=cellRef.split("/");
var n=x.length-1;
cellRef=x[n];
mc.setProperty("cellVersion",cellRef)]]></script>
<!-- Update cell -->
<property expression="get-property('rowNum')" name="row"
scope="default" type="STRING"/>
<property expression="get-property('updateColNum')"
name="col" scope="default" type="STRING"/>
<property expression="get-property('invoice')"
name="inputValue" scope="default" type="STRING"/>
<property expression="get-property('updateCellId')"
name="cellId" scope="default" type="STRING"/>
<property expression="get-property('cellVersion')"
name="cellV" scope="default" type="STRING"/>
<property expression="get-property('sheetKey')"
name="key" scope="default" type="STRING"/>
<property expression="get-property('sheetId')" name="id"
scope="default" type="STRING"/>
<property expression="get-property('accesstoken1')"
name="accesstoken" scope="default" type="STRING"/>
<googlespreadsheet.init>
<accessToken>{$ctx:accesstoken}</accessToken>
</googlespreadsheet.init>
<googlespreadsheet.updateCells>
<key>{$ctx:key}</key>
<worksheetId>{$ctx:id}</worksheetId>
<cellId>{$ctx:cellId}</cellId>
<inputValue>{$ctx:inputValue}</inputValue>
<row>{$ctx:row}</row>
<col>{$ctx:col}</col>
<cellVersion>{$ctx:cellV}</cellVersion>
</googlespreadsheet.updateCells>
</then>
<else/>
</filter>
</sequence>
</target>
</iterate>
</inSequence>
<outSequence/>
<faultSequence>
<log level="custom">
<property name="text" value="An unexpected error occured"/>
<property expression="get-property('ERROR_MESSAGE')" name="message"/>
</log>
</faultSequence>
</target>
<parameter name="ApplicationXMLBuilder.allowDTD">true</parameter>
</proxy>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev