SocketException: Connection reset

1,642 views
Skip to first unread message

Jay

unread,
Aug 2, 2011, 3:35:28 PM8/2/11
to ra...@googlegroups.com
I have an Application1 that connects to Application2 via a cfinvoke webservice.

<cfinvoke webservice="http://mydomain/synd/myCfc.cfc?wsdl" method="getResult" returnvariable="webClientResult">

    <cfinvokeargument name="ID" value="12345">
</cfinvoke>

when Application2 is running on IIS > ACF8 everything works fine, but when Application2 is running on Tomcat > Railo3

I keep getting a java.net.SocketException: Connection reset exception, with 'additional info' saying: cause = org.apache.axis.AxisFault

does anyone know why this happens / how to fix it?


Jay

here's the stack-trace:

; nested exception is: java.net.SocketException: Connection reset at java.net.SocketInputStream.read(Unknown Source):-1 at java.io.BufferedInputStream.fill(Unknown Source):-1 at java.io.BufferedInputStream.read1(Unknown Source):-1 at java.io.BufferedInputStream.read(Unknown Source):-1 at java.io.FilterInputStream.read(Unknown Source):-1 at org.apache.xerces.impl.XMLEntityManager$RewindableInputStream.read(Unknown Source):-1 at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source):-1 at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source):-1 at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source):-1 at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown Source):-1 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source):-1 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source):-1 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source):-1 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source):-1 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source):-1 at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source):-1 at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source):-1 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227):227 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696):696 at org.apache.axis.Message.getSOAPEnvelope(Message.java:435):435 at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62):62 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206):206 at org.apache.axis.client.Call.invokeEngine(Call.java:2784):2784 at org.apache.axis.client.Call.invoke(Call.java:2767):2767 at org.apache.axis.client.Call.invoke(Call.java:2443):2443 at org.apache.axis.client.Call.invoke(Call.java:2366):2366 at org.apache.axis.client.Call.invoke(Call.java:1812):1812 at railo.runtime.net.rpc.client.RPCClient._callMethod(RPCClient.java:388):388 at railo.runtime.net.rpc.client.RPCClient.callWithNamedValues(RPCClient.java:149):149 at railo.runtime.tag.Invoke.doWebService(Invoke.java:241):241 at railo.runtime.tag.Invoke.doEndTag(Invoke.java:187):187 at _test.ws_cfm$cf.call(C:\Websites\mysite\_test\ws.cfm:17):17 at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:728):728 at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:179):179 at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:23):23 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1985):1985 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1952):1952 at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:282):282 at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32 at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304):304 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240):240 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164):164 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462):462 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164):164 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100):100 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395):395 at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:306):306 at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:323):323 at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1719):1719 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source):-1 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source):-1 at java.lang.Thread.run(Unknown Source):-1

Todd Rafferty

unread,
Aug 2, 2011, 3:40:05 PM8/2/11
to ra...@googlegroups.com
Unknown Source. Are you sure your Tomcat/Railo can get to http://mydomain/synd/myCfc.cfc?wsdl ? - It looks like IIS / ACF can reach it, but it looks like Tomcat/Railo can't. Did you let your firewall let Tomcat see out?

--
~Todd Rafferty
Volunteer
Community Manager
Railo Server - Open Source
----

Jay

unread,
Aug 2, 2011, 3:58:01 PM8/2/11
to ra...@googlegroups.com
hi Todd,

I forgot to mention:  it works on average 7 out of 8 times so it's probably not a firewall issue.  

the thing is that I need it to work 8/8 times...

thanks,


Jay

Jay

unread,
Aug 2, 2011, 4:25:31 PM8/2/11
to ra...@googlegroups.com
looks like the problem is with an apache commons library called Axis

maybe "turning chunking off" will help.



does anyone know how to "turn off chunking"?  or where to set the Axis' defaults in Railo?

Jay

unread,
Aug 2, 2011, 5:21:55 PM8/2/11
to ra...@googlegroups.com
apparently this is a known issue and I found messages about it from 2009 in the forum, as well as a JIRA ticket https://issues.jboss.org/browse/RAILO-514

I'm posting here "my version of a fix" for the benefit of others who are going through this problem:

save the code below to a file named:  WebClient.cfc

then to use it from your code:

<cfset webServiceResult = createObject( "component", "WebClient" ).getRequest( "http://localhost/webservices/myService.cfc?method=Test&param1=value1&param2=value2&paramN=valueN" )>



<!--- WebClient.cfc begin --->
<cfcomponent>

<cffunction name="getRequest">

<cfargument name="requestUrl" hint="the full url of the request, e.g. http://localhost/webservices/myService.cfc?method=Test&param1=value1&param2=value2&paramN=valueN">
<cfset var Local = {}>
<cfset Local.result = "">
<cftry>
<cfhttp url="#requestUrl#" />
<cfif left( cfhttp.statusCode, 3 ) IS '200'>
<cfif IsWDDX( cfhttp.fileContent )>
<cfwddx action="wddx2cfml" input="#cfhttp.fileContent#" output="Local.result" />
<cfelse>
<cfset Local.result = cfhttp.fileContent>
</cfif>
<cfelse>
<cfset Local.result = cfhttp.statusCode>
</cfif>
<cfcatch>
<cflog file="#Application.ApplicationName#-500" text="#cfcatch.message# - cfhttp request to #requestUrl# failed" type="warning">
<cfset Local.result = cfcatch.message>
</cfcatch>
</cftry>
<cfreturn Local.result>
</cffunction>


</cfcomponent>



Lutz

unread,
Nov 4, 2011, 3:02:15 AM11/4/11
to ra...@googlegroups.com
Thanks for the workaround!!
Reply all
Reply to author
Forward
0 new messages