java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream

 java.lang.ClassNotFoundException: org.apache.commons.io.output.DeferredFileOutputStream
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1309)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1137)
    at org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:196)
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:358)
    at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
    at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:158)
    at org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:142)
    at org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:1175)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1010)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:800)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1471)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)

今天在做上传文件时候,遇到了

java.lang.ClassNotFoundException: org.apache.commons.io.output.DeferredFileOutputStream,这个文件没有被找到的异常,然后发现在原来是commons-fileupload jar 包从1.0升到1.1的时候。DeferredFileOutputStream.class被移除了。现在只能再引入一个依赖
commons-io
,这个jar包中包含上面的那个类.引入以后,一切运行正常.这个异常在以启动tomcat的时候,就会报出来这个异常,请打架小心留意.

原文地址:https://www.cnblogs.com/qingmuchuanqi48/p/10557566.html

时间: 2024-10-10 08:49:33

java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream的相关文章

java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream异常解决方法

使用Tomcat部署Servlet程序时,单步调试跟踪到: List<FileItem> itemList = sfu.parseRequest(request); 总是会报错:Java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream 直接运行后也是这个错误,解决方法: 添加引用包commons-io.jar到工程下,问题解决.有人说是commons-fileupload.jar包

maven:java.lang.NoClassDefFoundError: org/apache/commons/io/Charsets

今天从git上down了一个第三方jar ,这个jar里面用到了  String resultUrl = String.format(url,            URLEncoder.encode(ticket, Charsets.UTF_8.name())); 然而执行到这里的时候,就报错了: java.lang.NoClassDefFoundError: org/apache/commons/io/Charsets 第一反应就是jar包冲突了,看了下依赖,果然是有问题,如图所示: com

Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils

1.错误描述 警告: Could not create JarEntryRevision for [jar:file:/D:/MyEclipse/apache-tomcat-7.0.53/webapps/FirstSSH/WEB-INF/lib/struts2-core-2.3.16.3.jar]! java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils at com.opensymphony.xwork2.util.fs.

Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

MyEclipse运行的时候报错,菜鸟不理解是什么意思,最后找了一些资料才知道是因为缺少commons-logging.jar包 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:66) at c

spring异常记录-----java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

今天在练习怎样SSH中进行单元測试的时候出现下列异常: SEVERE: Exception starting filter Struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:211

关于java.lang.NoClassDefFoundError: org/apache/commons/collections/FastHashMap的错误解决办法

在JavaEE开发中,在把配置文件中的数据或用户表单提交上来的数据,封装在相应JavaBean的对象的对应属性中时:在实际开发中,使用第三方法工具包BeanUtils(commons-beanutils-xxx.jar 依赖于commons-logging-xx.jar). 如博主在JavaWeb工程中,导入的jar包:commons-beanutils-1.9.3.jar和commons-logging-1.2.jar 这是在运行时报错了:eption in thread "main"

struts2与struts1整合,java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

原因:我往项目的WEB-INF/lib中导入了struts2基本的包,还有struts1的core包,以及struts2-strut1-plugin的包,但是没有导入commons-loggin-1.3.1这个包,如下图 我打开commons-loggin-1.3.1这个包看了一下,果然找到了这个组件的class文件 看到这个错误的时候,我感觉就应该i啊是commons-logging这个包没有添加导致的,添加上就好了 struts2与struts1整合,java.lang.NoClassDef

异常记录与处理 - java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

错误信息: 学习Spring,执行简单的单元测试程序时,产生以下异常: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:160) at org.springframework.context.su

Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException

转载:http://www.tuicool.com/articles/Vvia6f 缺少相应jar包都会有异常,根据异常找jar包导入...... 这里我说下lang包,因为这个包我找了好半天: 我用的是: commons-lang3-3.1.jar  出现异常: java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException 可以看出是因为缺少jar包,但是很明显我已经导入了,