使用Struts2上传文件,在linux下报错
2009-09-29 14:56:20,801 [org.apache.struts2.interceptor.FileUploadInterceptor]-[ERROR] Processing of multipart/form-data request failed. c:/temp/upload__1dcd07ee_12403868e6f__7fe7_00000015.tmp (没有该文件或目录 (errno:2))
 2009-09-29 14:56:20,801 [org.apache.struts2.dispatcher.Dispatcher]-[ERROR] Could not find action or result
 No result defined for action Freesky.M8.MM.sd.action.TvShoppingImportFileAction and result input - action - file:/opt/IBM/WebSphere/AppServer/profiles/Custom01/installedApps/sth23v03Node01Cell/mmbs_war.ear/mmbs.war/WEB-INF/classes/struts-mm.xml:134:103
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:350)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
如何解决?
在windows服务器下是好的

解决方案 »

  1.   

    我比你还郁闷呢,本地怎么测试都没问题,一放到服务器上就报错
    感觉你这个应该是路径问题吧,Linux下怎么回有C:\这种东西呢,关注ing~
      

  2.   

    你的路径写的有问题注意linux下的斜杠
      

  3.   

    c:/temp/upload__1dcd07ee_12403868e6f__7fe7_00000015.tmp (没有该文件或目录 (errno:2)) 路径问题啊!linux可没有盘符啊
      

  4.   

    上面提示已经很清楚了:
     c:/temp/upload__1dcd07ee_12403868e6f__7fe7_00000015.tmp (没有该文件或目录 (errno:2)) 
      

  5.   

    你把你的路径改成这样就可以跨平台了:String tempDir = System.getProperty("java.io.tmpdir");
      

  6.   

    如果上传文件临时目录是在配置文件中的话,需要配置成 Linux 下的路径
      

  7.   

    我也遇到类似的问题
    2010-05-07 11:54:01 [File]-[WARN] - Struts has detected a file upload UI tag (s:file) being used without a form set to enctype 'multipart/form-data'. This is probably an error!
    2010-05-07 11:54:01 [Form]-[WARN] - No configuration found for the specified action: 'unit/uploadFile.action' in namespace: '/unit'. Form action defaulting to 'action' attribute's literal value.
    怎么回事啊 急!!!!!!!!!!!!!!!!!!