简体   繁体   English

Struts文件上传不适用于lib文件夹中的jar文件

[英]Struts file upload not working with jar files in lib folder

Can someone help me please ? 有人能帮助我吗 ? I am stuck and don't have any clue. 我被困住了,没有任何线索。

I want to upload a file in struts 1.2. 我想在struts 1.2中上传文件。 I know that struts uses 'commons-io.jar' and 'commons-fileupload.jar' for file upload and I need to place these jars in WebContent / Web-INF / lib folder. 我知道struts使用'commons-io.jar'和'commons-fileupload.jar'进行文件上传,我需要将这些jars放在WebContent / Web-INF / lib文件夹中。 I placed the jars in lib folder but application is giving class definition not found error. 我将罐子放在lib文件夹中,但应用程序给出了类定义未找到错误。 I tried creating a lib folder and placing these jar files under WEB-INF folder. 我尝试创建一个lib文件夹并将这些jar文件放在WEB-INF文件夹下。 I also tried adding these jar files in build path but still giving same below error. 我也尝试在构建路径中添加这些jar文件,但仍然在以下错误中给出相同的内容。 I also tried using 3 differnet versions (1, 1.4, 2.4) of 'commons-io.jar'. 我还尝试使用'commons-io.jar'的3个differnet版本(1、1.4、2.4)。

Can some one help please ? 可以帮忙一下吗?

java.lang.NoClassDefFoundError: org.apache.commons.io.output.DeferredFileOutputStream
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:59)
at java.lang.J9VMInternals.verify(J9VMInternals.jenter code hereava:57)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:120)

This normally happens when the commons-io.jar is missing from your class path Right Click on Your Project . 当类路径中缺少commons-io.jar时,通常会发生这种情况。右键单击Project。 and upload all latest version Commons jar files 并上传所有最新版本的Commons jar文件

  • Right Click On Project. 右键单击项目。
  • Go to Properties. 转到属性。
  • Go to Library Tab. 转到库选项卡。
  • Add Jar . 添加Jar。
  • Clean and Build 清洁和建造
  • upload updated war file on tomcat webapp folder. 将更新的war文件上传到tomcat webapp文件夹中。
  • start tomcat . 启动tomcat。 Hope this will Help Thanks 希望这会有所帮助谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM