-
FEATURED COMPONENTS
First time here? Check out the FAQ!
asked 2013-01-31 11:55:39 +0800
This post is a wiki. Anyone with karma >100 is welcome to improve it.
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
answered 2013-01-31 13:20:04 +0800
This post is a wiki. Anyone with karma >100 is welcome to improve it.
I am sure you missed jars in your project you need
- commons-fileupload.jar
- commons-io.jar
For uploading the file for more information you can refer this official documents ZK Jars Information
Asked: 2013-01-31 11:55:39 +0800
Seen: 37 times
Last updated: Jan 31 '13
Do you have Apache Commons FileUpload libraries in your lib directory?
sjoshi ( 2013-01-31 12:02:46 +0800 )editI was using org.zkoss.zul.Fileupload Do i need to use diffent API?
Piyali ( 2013-01-31 12:35:33 +0800 )editI have tried all the file upload code available, none works out. Facing same problem for all.
Piyali ( 2013-01-31 12:38:07 +0800 )editall these jars are there in the lib folder of WEB-INF..
Piyali ( 2013-01-31 14:19:36 +0800 )edit