5 Replies Latest reply on Apr 4, 2008 5:12 PM by akakunin

    fileUpload - NullPointerException: Colors cannot be null

      Hi.

      I have a strange problem with the fileUpload component.
      I got the following NullPointerException:



      13:42:46,630 ERROR [[default]] Servlet.service() for servlet default threw exception
      java.lang.NullPointerException: Colors cannot be null
      at java.awt.GradientPaint.<init>(GradientPaint.java:71)
      at org.richfaces.renderkit.html.images.ProgressBarAnimatedBg.paint(ProgressBarAnimatedBg.java:92)
      at org.ajax4jsf.resource.AnimationResource.send(AnimationResource.java:80)
      at org.ajax4jsf.resource.ResourceLifecycle.sendResource(ResourceLifecycle.java:221)
      at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:157)
      at org.ajax4jsf.resource.InternetResourceService.load(InternetResourceService.java:333)
      ....


      That's the component;


      ...
      <rich:fileUpload id="uploadComponent" uploadData="#{testBean.data}" fileUploadListener="#{testBean.upload}" />
      ...


      I'm using the JSF-RI, Seam and Facelets.

      Did anybody get the same exception?
      Any ideas?


        • 1. Re: fileUpload - NullPointerException: Colors cannot be null
          roykachouh

          I am having the same issue. The weird thing is that it is not consistent. I would say it happens about 75% of time, but for some reason it will work after a few attempts. At first, I thought it was a problem with certain images, but then I realized that images that were being uploaded at one point would stop after another attempt.

          I added all the javascript event handlers to capture each event, when this exemption is thrown the oncomplete event is fired as normal.

          I also added a comment to the Richfaces JIRA. It seems that this was a known issues that was closed, but I'm not so sure that it is working now...the jira link is here...

          http://jira.jboss.org/jira/browse/RF-2689?page=comments

          "hebe" wrote:
          Hi.

          I have a strange problem with the fileUpload component.
          I got the following NullPointerException:



          13:42:46,630 ERROR [[default]] Servlet.service() for servlet default threw exception
          java.lang.NullPointerException: Colors cannot be null
          at java.awt.GradientPaint.<init>(GradientPaint.java:71)
          at org.richfaces.renderkit.html.images.ProgressBarAnimatedBg.paint(ProgressBarAnimatedBg.java:92)
          at org.ajax4jsf.resource.AnimationResource.send(AnimationResource.java:80)
          at org.ajax4jsf.resource.ResourceLifecycle.sendResource(ResourceLifecycle.java:221)
          at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:157)
          at org.ajax4jsf.resource.InternetResourceService.load(InternetResourceService.java:333)
          ....


          That's the component;


          ...
          <rich:fileUpload id="uploadComponent" uploadData="#{testBean.data}" fileUploadListener="#{testBean.upload}" />
          ...


          I'm using the JSF-RI, Seam and Facelets.

          Did anybody get the same exception?
          Any ideas?


          • 2. Re: fileUpload - NullPointerException: Colors cannot be null
            ilya_shaikovsky

            I've seen this once but it was disappears after cache clearance and does not appears anymore.

            • 3. Re: fileUpload - NullPointerException: Colors cannot be null
              roykachouh

              Do you mean clearing the browser cache?

              • 4. Re: fileUpload - NullPointerException: Colors cannot be null
                ilya_shaikovsky

                I've cleared both server and browser one..

                • 5. Re: fileUpload - NullPointerException: Colors cannot be null
                  akakunin

                  In my case simple clearing the browser-cache helped to solve this problem