0

Problem in upload a csv file using zk5.0.6

asked 2013-01-31 11:55:39 +0800

this post is marked as community wiki

This post is a wiki. Anyone with karma >100 is welcome to improve it.

updated 2013-02-01 01:47:14 +0800

jimyeh gravatar image jimyeh
2047 1 4
ZK Team

while selecting a file and click open then The server is temporarily out of service. this error is coming. in the console

org.zkoss.zk.au.http.AuUploader handleError:218 SEVERE: Failed to upload

java.lang.NoSuchMethodError: org.apache.commons.fileupload.FileUploadBase.isMultipartContent(Lorg/apache/commons/fileupload/RequestContext;)Z at org.zkoss.zk.au.http.AuUploader.isMultipartContent(AuUploader.java:393) at org.zkoss.zk.au.http.AuUploader.service(AuUploader.java:98) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:431) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:465) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

.zul file contains the following code

<window id="Window" title="File Upload" border="normal" width="200px">

        <div apply="${adminWorkbenchComposer}">
            <button id="fileUpload" label="File Upload"/>
        </div>
    </window>

composer cntains the following code

public class AdminWorkbenchComposer extends GenericForwardComposer{
    private static final Logger LOGGER = Logger.getLogger(AnalystWorkbenchComposer.class);

    private org.zkoss.zul.Window Window;

    public Media[] media ;
    public Media[] uploadMedia;

    public void doAfterCompose(Component comp) throws Exception {
        //. Thus if you override this method please make sure to call the super method
        super.doAfterCompose(comp);

        Executions.getCurrent().getDesktop().setAttribute("org.zkoss.zul.Fileupload.target", Window);  

    }       

    public void onClick$fileUpload(Event event){

        try {
            media = Fileupload.get(-1);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

    public void onUpload$Window(UploadEvent event){

        uploadMedia = event.getMedias();

    }
}

i am using tomcat 6 and java 1.6

delete flag offensive retag edit

Comments

Do you have Apache Commons FileUpload libraries in your lib directory?

sjoshi ( 2013-01-31 12:02:46 +0800 )edit

I was using org.zkoss.zul.Fileupload Do i need to use diffent API?

Piyali ( 2013-01-31 12:35:33 +0800 )edit

I have tried all the file upload code available, none works out. Facing same problem for all.

Piyali ( 2013-01-31 12:38:07 +0800 )edit

all these jars are there in the lib folder of WEB-INF..

Piyali ( 2013-01-31 14:19:36 +0800 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-01-31 13:20:04 +0800

this post is marked as community wiki

This post is a wiki. Anyone with karma >100 is welcome to improve it.

updated 2013-01-31 13:20:04 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

I am sure you missed jars in your project you need

  1. commons-fileupload.jar
  2. commons-io.jar

For uploading the file for more information you can refer this official documents ZK Jars Information

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-01-31 11:55:39 +0800

Seen: 37 times

Last updated: Jan 31 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More