gpt4 book ai didi

java - Genexus Uploadify 不适用于大文件

转载 作者:行者123 更新时间:2023-11-28 23:25:24 27 4
gpt4 key购买 nike

我有一个用 Genexus 创建的网站,其中包含一个 Uploadify 控件,在本地 Tomcat 服务器上运行,它可以很好地处理小文件,但是当我尝试上传一个更大的文件(> 50 MB)时,它似乎在上传文件,但随后返回到交易屏幕。

我使用 Google Chrome 中包含的开发人员工具进行了测试,我注意到,当我尝试上传大文件时,出现“500 - 内部服务器错误”。单击“网络”选项卡中的相应行会显示以下内容:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.NoSuchMethodError: org.apache.commons.fileupload.DefaultFileItem.cleanup()V
at com.genexus.webpanels.HttpContextWeb.cleanup(Unknown Source)
at com.genexus.webpanels.GXWebObjectBase.doExecute(Unknown Source)
at br.com.procempa.spm.cauge.texpedientessoliceventosalter.doExecute(texpedientessoliceventosalter.java:21)
at com.genexus.webpanels.GXWebObjectStub.callExecute(Unknown Source)
at com.genexus.webpanels.GXWebObjectStub.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:420)
at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:873)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)

com.genexus.webpanels.GXWebObjectStub.callExecute(Unknown Source)
com.genexus.webpanels.GXWebObjectStub.doPost(Unknown Source)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:420)
org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:170)
javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.28 logs.

Apache Tomcat/5.5.28

在一些网站上搜索,我发现建议编辑应用程序的 web.xml,在 tomcat-directory/application-directory/WEB-INF/web.xml 的 标记内添加以下标记:

<multipart-config>
<max-file-size>1073741824</max-file-size>
<max-request-size>1073741824</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config>

然后编辑 tomcat-directory/conf/server.xml 使端口 8080 的连接器标记如下所示:

<Connector port="8080" maxHttpHeaderSize="4096" maxPostSize="1073741824"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="600000" disableUploadTimeout="true" />

然后重新启动 Tomcat,但它给了我同样的错误。我还遗漏了什么吗?

提前致谢!

编辑: 实际上,我的应用程序是一个 Java 应用程序,使用的控件不是真正的“Uploadify”,它具有类“Image”并链接到数据库中的 BLOB 字段。更改交易表单中的字段类型不就是这样吗?

最佳答案

在您的表单中检查 Uploadify 属性“大小限制”。

在 web.config 中检查 maxRequestLength<system.web>requestLimits maxAllowedContentLength<security> .

例子:

<system.web>
<httpRuntime requestValidationMode="2.0" executionTimeout="600" maxRequestLength="50000"/>
</system.web>

<system.webServer>
<security>
<requestFiltering>
<hiddenSegments>
<add segment="PrivateTempStorage" />
<add segment="private" />
</hiddenSegments>
<requestLimits maxAllowedContentLength="50000000"/>
</requestFiltering>
</security>
</system.webServer>

关于java - Genexus Uploadify 不适用于大文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37925795/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com