0 Replies Latest reply on Mar 19, 2015 5:06 PM by bmelberg

    richfaces fileUpload throws exception when Upload button is selected in JBOSS 6.1

    bmelberg

      We are using JBOSS 6.1 and the JSF implementation is 1.2. We are also using Richfaces 4.3.7. The problem I am having is when using the the rich:fileUpload component. Everything works fine until I select "Upload". I then receive the exception (see attachment) in the server application log.

       

      My xhtml contains the following:

       

      <rich:fileUpload fileUploadListener="#{fileUploadBean.uploadFile}" addLabel="Browse ..." clearAllLabel="Clear" id="upload" acceptedTypes="xml"

                     ontyperejected="alert('Only XML files are accepted');"  noDuplicate="true" style="width:820px">

      </rich:fileUpload>

       

      My Bean listener method contains the following :

       

      public void uploadFile (FileUploadEvent event) throws Exception {

             

              try {

              log.info("Entered uploadFile");

              if (event == null) {

                  log.info("FileUploadEvent is null");

              }

              uploadedFile = event.getUploadedFile();

              fileName = uploadedFile.getName();

              log.info("FileName: " + fileName);

              }

              catch(Exception e) {

                  log.info("exception is: " + e.getMessage());

              }

             

          }

       

      I really don't understand what the exception is complaining about. What is null  - JBWEB000236: Servlet.service() for servlet Faces Servlet threw exception: java.lang.NullPointerException ?

      I have been debugging this for hours and I don't see what I am doing wrong.

       

      I would appreciate your feedback.

       

      Thank you.

       

      Bruce