Apache commons -> File Upload -> parseRequest() error

家住魔仙堡 提交于 2019-12-06 10:30:41
BalusC

This is indeed a sign of classpath pollution. You have different versions of the commons fileupload JAR file spreading over the classpath. You need to clean up the classpath by removing or replacing the older-versioned ones. In case of a JSP/Servlet webapplication, the default paths which are covered by the classpath are usually the Webapp/WEB-INF/lib, Webapp/WEB-INF/classes, Appserver/lib and the JRE/lib.

That said, the stacktrace also indicates that you wrote raw Java code inside JSP files using the old fashioned scriptlets. I would strongly recommend not to do so, but just to use a real Java class (in this case a Servlet) to handle the file upload.

noSuchMethod error could be caused by a mismatch between the version of the jar you compiled against and the jar in the runtime classpath. This is something to double-check.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!