3 Replies Latest reply on Jun 8, 2010 2:40 AM by Ilya Shaikovsky

    NullPointerException while UploadItem.getData() in <rich:fileUpload>

    Elena Veretilo Newbie

      Hi all! I have one more problem(

      I want to use <rich:fileUpload> example from:

      http://livedemo.exadel.com/richfaces-demo/richfaces/fileUpload.jsf?tab=usage&cid=1447304

       

      But I get NullPointerException while UploadItem.getData() in FileUploadBean.java:

       

      public void listener(UploadEvent event) throws Exception{
       UploadItem item = event.getUploadItem();
       File file = new File();
       file.setLength(item.getData().length);
       file.setName(item.getFileName());
       file.setData(item.getData());
       files.add(file);
       uploadsAvailable--;
       }  
      

       

      item.getData() - throws NullPointerException.

       

      Here is my xhtml page:

       

      What could be wrong?

       

      Please - I need your help as soon as possible!

       

      Thanks and good luck!