XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset

Anonymous
Not applicable

XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset

Hi. I am using Soap to connect to Marketo and send data.
On some load scenarios i am getting this error.
Any idea why this might happen?

thanks, Michal
Tags (1)
7 REPLIES 7
Anonymous
Not applicable

Re: XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset

The error message on its own does not clarify the context of that error.

Please copy the complete Java error stack everytime you seek assisatnce from anyone, not just Marketo.

To clarify, that sort of error is presented as
Caused By: java.net.SocketException: Connection reset  
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:96)  
    at java.net.SocketOutputStream.write(SocketOutputStream.java:136)  
(long stack, supressed here as it is intended to be an example only)

The error I posted above was thrown by Oracle BEA/Weblogic running on my localhost.

That sort of error is unrelated to Marketo or SOAP API. I forced it directly through PHP initiating a call to BEA/Weblogic running on a second localhost.

The lack of details allow me to post generic suggestions only.

It may be  a symptom of a thread pool exhausted by initialization or an application server having trouble procesing blocks equal or geater than 4 KB.

In the syncMultipleLeads context that could be mitigated by a significant reduction in the number of leads per API call. Try half to start troubleshooting and, if no error, try gradual increases. There is no generic guideline since the block size is a combination of number of records and number of attributes per record.

 
Anonymous
Not applicable

Re: XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset

Hi. the reason i did not post the entire stack trace is cause it is not general and specific to my code:
I am sending one lead at a time and openning a client connection every time. should i use some connection pool to Marketo to solve this?

com.leadspace.external.marketo.MarketoClientException: Exception occurred while initializing Marketo Client, exception: XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset
at com.leadspace.external.marketo.MarketoClient.init(MarketoClient.java:85)
at com.leadspace.external.marketo.MarketoClient.<init>(MarketoClient.java:59)
at com.leadspace.controller.task.MarketoDataService.getClient(MarketoDataService.java:45)

at com.leadspace.controller.task.MarketoDataService.syncData(MarketoDataService.java:122)
at com.leadspace.controller.task.MarketoDataService.sendToConcreteSource(MarketoDataService.java:68)
at com.leadspace.controller.task.ExternalApiDataService.sendToSource(ExternalApiDataService.java:120)
at com.leadspace.controller.task.ExternalApiDataService.updateData(ExternalApiDataService.java:64)
at com.leadspace.controller.task.ExternalApiDataService.updateSpotlightResponse(ExternalApiDataService.java:49)
at com.leadspace.controller.task.ExternalDataHandler.execute(ExternalDataHandler.java:40)
at com.leadspace.common.messaging.taskexecutors.SyncTaskExecutor.operate(SyncTaskExecutor.java:38)
at com.leadspace.common.messaging.services.BasicTaskService.operate(BasicTaskService.java:55)
at com.leadspace.common.messaging.listeners.ServicesCollector.operate(ServicesCollector.java:136)
at com.leadspace.common.messaging.listeners.ServicesCollector.onMessage(ServicesCollector.java:77)
at org.springframework.jms.listener.adapter.MessageListenerAdapter.onMessage(MessageListenerAdapter.java:330)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:537)
at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:497)
at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1103)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1095)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:992)
at java.lang.Thread.run(Thread.java:662)
Anonymous
Not applicable

Re: XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset

I agree, the stack trace is specific to each environment. However always it ocntains the key details to troubleshoot. 

There is no need to worry about Marketo or SOAP API for now.

You would need to move the focus to the Beans environment profile for JMS (Java Message Service) - that is where the problem happens.

In a wider context, the troublehooting will be around the Spring Framework.


 
Anonymous
Not applicable

Re: XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset

There is no relation to the spring framework.
As you can see there is an exception while openning a connection to the Marketo, this is the line of code that fails, so how is this connected to spring exactly?

try {
             service = new MktMktowsApiService(new URL(this.endPoint+"?WSDL"),
                                               new QName("http://www.marketo.com/mktows/", "MktMktowsApiService"));

         }
         catch (MalformedURLException e) {
             throw new MarketoClientException("Exception occurred while initializing Marketo Client", e);
         }
         catch(Throwable e){
             throw new MarketoClientException("Exception occurred while initializing Marketo Client, exception: "+e.getMessage());
         }
Anonymous
Not applicable

Re: XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset

Fair enough you are not declaring the Spring Framework explicitly. It is being added implicitly. From the error stack:
 
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:992)
at java.lang.Thread.run(Thread.java:662)

The code fragment is helpful. I woudl suggest reviwing the SOAP endpoint. For Leadspace it would behttps://XXX-YYY-ZZZ.mktoapi.com/soap/mktows/2_3

I deliberately replaced the actual ID with XXX-YYY-ZZZ. You can find the value in Admin - SOAP API.

The complete code sample in Java may help.
Anonymous
Not applicable

Re: XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset

I checked the end point and it looks fine - like what you sent.
This erro does not happen all the time for this customer, it happends under load of data sent. So i don't think there is a basic problem otherwise everything would not work, I think it has to do with the load.



<code>
    private void init(){
        MarketoUtil.objectFactory = new ObjectFactory();
         MktMktowsApiService service = null;
         try {
             service = new MktMktowsApiService(new URL(this.endPoint+"?WSDL"),
                                               new QName("http://www.marketo.com/mktows/", "MktMktowsApiService"));
         }
         catch (MalformedURLException e) {
             throw new MarketoClientException("Exception occurred while initializing Marketo Client", e);
         }
         catch(Throwable e){
             throw new MarketoClientException("Exception occurred while initializing Marketo Client, exception: "+e.getMessage());
         }
         this.proxy = service.getMktowsApiSoapPort();
         Map<String, Object> ctxt = ((BindingProvider)this.proxy ).getRequestContext();
         ctxt.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, this.endPoint);
         
         System.setProperty("javax.xml.bind.JAXBContext",
                 "com.sun.xml.internal.bind.v2.ContextFactory");
    }
</code>
Anonymous
Not applicable

Re: XML reader error: com.ctc.wstx.exc.WstxIOException: Connection reset

The root cause is unrelated to Marketo and/or SOAP API otherwise it would fail from the outset. That is reinforced by "This error does not happen all the time for this customer, it happends under load of data sent."

That is a strong symptom of a severely overloaded web server, either by intense traffic or insufficient resources. In such circumstances the amount of XML to parse goes beyond the capacity to parse it.

I would suggest reducing the number of records in syncMultipleLeads or getMultipleLeads to half of the current volume.
That would alleviate the server load.