file upload in liferay with vaadin in liferay 6

i am trying to write a portlet that handle file uploading with vaadin.
in my code add file upload component done correctly but when i click upload button then don’t enter in “receiveUpload” method to i do other tasks.
my code in the below:

public class AddressBookApplication extends Application
private Window main = new Window(“test”);

public void init() {
private Label result = new Label();

   private LineBreakCounter counter = new LineBreakCounter();

   private Upload upload = new Upload("Upload a file", counter);

   public AddressBookApplication() {
       upload.addListener(new Upload.FinishedListener() {
           public void uploadFinished(FinishedEvent event) {
               result.setValue("Uploaded file contained "
                       + counter.getLineBreakCount() + " linebreaks");


   public static class LineBreakCounter implements Receiver {

       private String fileName;
       private String mtype;
       private int counter;

        * return an OutputStream that simply counts lineends
       public OutputStream receiveUpload(String filename, String MIMEType) {
           // this line because of i know that enter in this method
           counter = 0;
           fileName = filename;
           mtype = MIMEType;
           return new OutputStream() {
               private static final int searchedByte = '\n';

               public void write(int b) throws IOException {
                   if (b == searchedByte) {

       public String getFileName() {
           return fileName;

       public String getMimeType() {
           return mtype;

       public int getLineBreakCount() {
           return counter;



please help me !!!

nobody help me???

when i implement PortletApplicationContext2.PortletListener then after i click upload button, handleActionRequest called instead of receiveUpload method.
how i relate this two method that i access file that user upload.

Have you checked (using ?debug) that your servlet version and widgetset version match? I copy/pasted your example into a new Vaadin portlet project, deployed it and upload worked just fine reporting “Uploaded file contained 39 linebreaks”

do you test my code in liferay6 portal as a portlet?
my code work in vaadin project ok. but when i use this as portlet in liferay portal don’t work