Coldfusion Web 服务无法上传文件

Coldfusion Web Service cannot upload files

我有一个用于上传文件的 coldfusion 网络服务,这里是上传功能:

<cffunction access="remote" name="UploadFile" output="yes" returntype="string" verifyclient="no" securejson="false">
        <cfargument name="SiteName" type="string" displayname="SiteName" hint="SiteName">
        <cfargument name="PartFileName" type="string" displayname="PartFileName" hint="PartFileName">
        <cfargument name="FileBody" type="binary" displayname="PictureBody" hint="PictureBody">
        <cfargument name="TargetFolder" type="string" displayname="TargetFolder" hint="TargetFolder">

        <cfset var filePath="C:\web\#arguments.SiteName#\#arguments.TargetFolder#">

        <cfdirectory directory="#filePath#" action="list" name="dirList" filter="#arguments.PartFileName#">
        <cfloop query="#dirList#">
            <cffile action="delete" file="#filePath#\#arguments.PartFileName#">
        </cfloop>

        <cfscript>
            FileWrite("#filePath#\#arguments.PartFileName#", "#arguments.FileBody#");
        </cfscript>

        <cfreturn PartFileName>
    </cffunction>

当我尝试上传大于零字节的文件时(一个空的 txt 文件成功上传),我得到这个异常:

coldfusion.filter.AxisFilter$WebServiceInvocationException: The web service operation caused an invocation exception.

The web service operation caused an invocation exception.


coldfusion.filter.AxisFilter.invoke(AxisFilter.java:95)
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:451)
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:155)
coldfusion.xml.rpc.CFCServlet.doPost(CFCServlet.java:331)
javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
sun.reflect.GeneratedMethodAccessor62.invoke(null:???)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:97)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:472)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:312)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:192)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:507)
com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36)
sun.reflect.GeneratedMethodAccessor63.invoke(null:???)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:79)
sun.reflect.GeneratedMethodAccessor61.invoke(null:???)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:53)
com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut.invoke(NewFilterChainPointCut.java:41)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:???)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:724)




Caused By:

ClientAbortException:  java.net.SocketException: Connection reset by peer: socket write error


org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:417)
org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480)
org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:363)
org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:337)
org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:101)
com.intergral.fusionreactor.j2ee.filter.surrogate.FusionReactorServletResponseInterposer.flush(FusionReactorServletResponseInterposer.java:85)
com.intergral.fusionreactor.j2ee.trackedstream.TrackedStream2.flush(TrackedStream2.java:61)
com.intergral.fusionreactor.j2ee.filter.softkill.SoftKillResponseStream.flush(SoftKillResponseStream.java:158)
com.intergral.fusionreactor.j2ee.filter.softkill.SoftKillResponseWrapper.flushBuffer(SoftKillResponseWrapper.java:65)
javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:160)
com.intergral.fusionreactor.j2ee.filter.FusionReactorResponseWrapper.flushBuffer(FusionReactorResponseWrapper.java:293)
org.apache.axis.transport.http.AxisServlet.sendResponse(AxisServlet.java:909)
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:777)
coldfusion.xml.rpc.CFCServlet.doAxisPost(CFCServlet.java:295)
coldfusion.filter.AxisFilter.invoke(AxisFilter.java:75)
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:451)
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:155)
coldfusion.xml.rpc.CFCServlet.doPost(CFCServlet.java:331)
javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
sun.reflect.GeneratedMethodAccessor62.invoke(null:???)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:97)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:472)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:312)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:192)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:507)
com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36)
sun.reflect.GeneratedMethodAccessor63.invoke(null:???)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:79)
sun.reflect.GeneratedMethodAccessor61.invoke(null:???)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:53)
com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut.invoke(NewFilterChainPointCut.java:41)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:???)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:724)





Caused By:

java.net.SocketException: Connection reset by peer: socket write error

Connection reset by peer: socket write error



java.net.SocketOutputStream.socketWrite0(SocketOutputStream.java:???)[Native Method]
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
java.net.SocketOutputStream.write(SocketOutputStream.java:153)
org.apache.coyote.ajp.AjpProcessor.output(AjpProcessor.java:307)
org.apache.coyote.ajp.AbstractAjpProcessor$SocketOutputBuffer.doWrite(AbstractAjpProcessor.java:1258)
org.apache.coyote.Response.doWrite(Response.java:520)
org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:412)
org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:480)
org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:363)
org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:337)
org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:101)
com.intergral.fusionreactor.j2ee.filter.surrogate.FusionReactorServletResponseInterposer.flush(FusionReactorServletResponseInterposer.java:85)
com.intergral.fusionreactor.j2ee.trackedstream.TrackedStream2.flush(TrackedStream2.java:61)
com.intergral.fusionreactor.j2ee.filter.softkill.SoftKillResponseStream.flush(SoftKillResponseStream.java:158)
com.intergral.fusionreactor.j2ee.filter.softkill.SoftKillResponseWrapper.flushBuffer(SoftKillResponseWrapper.java:65)
javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:160)
com.intergral.fusionreactor.j2ee.filter.FusionReactorResponseWrapper.flushBuffer(FusionReactorResponseWrapper.java:293)
org.apache.axis.transport.http.AxisServlet.sendResponse(AxisServlet.java:909)
org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:777)
coldfusion.xml.rpc.CFCServlet.doAxisPost(CFCServlet.java:295)
coldfusion.filter.AxisFilter.invoke(AxisFilter.java:75)
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:451)
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
coldfusion.filter.PathFilter.invoke(PathFilter.java:112)
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94)
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:155)
coldfusion.xml.rpc.CFCServlet.doPost(CFCServlet.java:331)
javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
sun.reflect.GeneratedMethodAccessor62.invoke(null:???)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:97)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:472)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:312)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:192)
com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:507)
com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36)
sun.reflect.GeneratedMethodAccessor63.invoke(null:???)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:79)
sun.reflect.GeneratedMethodAccessor61.invoke(null:???)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:53)
com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut.invoke(NewFilterChainPointCut.java:41)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:???)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:422)
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:199)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:724)

我怀疑这与 FusionReactor 有关,但我检查了所有 Reactor 设置,并且在日志中没有看到任何 FusionReactor 拒绝。

注意:上传在我的开发服务器上正常工作没有安装了 FusionReactor。

注意:此 Coldfusion 实例已更新至补丁级别 17,并且 IIS 连接器已更新至正确版本。

这原来是 IIS 连接器问题,有 2 个 ws_config 文件夹,第一个实例是旧连接器,第二个实例具有正确更新的 IIS 连接器。我原以为我们使用的是 2 中较新的,但事实证明,通过升级第一个实例连接器,这些上传开始工作。感谢所有看过这个问题的人。