Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.7.2
    • Component/s: None
    • Labels:
      None
    • Environment:
      NA

      Description

      File upload fails randomly with following exception:

      2008-06-13 14:53:40,075 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/inputFile].[uploadServlet]] Servlet.service() for servlet uploadServlet threw exception
      javax.faces.el.EvaluationException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'inputFile' resolved to null
      at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:84)
      at com.icesoft.faces.component.inputfile.InputFile.setProgress(InputFile.java:866)
      at com.icesoft.faces.webapp.http.core.UploadServer$ProgressCalculator.potentiallyNotify(UploadServer.java:167)
      at com.icesoft.faces.webapp.http.core.UploadServer$ProgressCalculator.setListenerAndContextAndPFS(UploadServer.java:143)
      at com.icesoft.faces.webapp.http.core.UploadServer$2.servlet(UploadServer.java:70)
      at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.detectEnvironment(ServletRequestResponse.java:222)

      Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'inputFile' resolved to null
      at org.apache.el.parser.AstValue.getTarget(AstValue.java:46)
      at org.apache.el.parser.AstValue.invoke(AstValue.java:127)
      at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)

        Issue Links

          Activity

          Mandeep Hayher created issue -
          Mandeep Hayher made changes -
          Field Original Value New Value
          Assignee Mark Collette [ mark.collette ]
          Ken Fyten made changes -
          Fix Version/s 1.7.1 [ 10122 ]
          Assignee Priority P1
          Hide
          Mark Collette added a comment -

          It looks like the progress code is trying to access the inputFile's progressListener bean, but it can't. I think it's because that bean is in request scope, and that other lifecycles, like WebMC chat server pushes, and the new inputFile form posts, may be deconstructing/constructing the request scoped bean Map, while the inputFile is trying to access it, effectively outside of a request. Actually, from how the OnDemandRenderer works, which is called from the progressListener itself, a previous invocation of the OnDemandRenderer might interfere with a subsequent progress update, without even needing the other types of lifecycles. It's just that the more we add, the more reproducible this may become.

          The simplest work-around, which seems to have helped, was to not actually use the progressListener to call the OnDemandRenderer, but instead to just use the form post notifications, meant for synchronous mode, to update an indeterminate progress bar. Mandeep didn't seem to be able to reproduce it after that.

          Another work-around may be to just use a session scoped bean.

          To make this less likely to happen, and also for backwards compatibility, we should probably do:
          ICE-3122 : iinputFile selectively post form
          http://jira.icefaces.org/browse/ICE-3122

          But, the real solution will involve investigating how we alter the request Map, and putting protection around that, which we'll use in the UploadServer, around when it tries to access the progressListener bean.

          Show
          Mark Collette added a comment - It looks like the progress code is trying to access the inputFile's progressListener bean, but it can't. I think it's because that bean is in request scope, and that other lifecycles, like WebMC chat server pushes, and the new inputFile form posts, may be deconstructing/constructing the request scoped bean Map, while the inputFile is trying to access it, effectively outside of a request. Actually, from how the OnDemandRenderer works, which is called from the progressListener itself, a previous invocation of the OnDemandRenderer might interfere with a subsequent progress update, without even needing the other types of lifecycles. It's just that the more we add, the more reproducible this may become. The simplest work-around, which seems to have helped, was to not actually use the progressListener to call the OnDemandRenderer, but instead to just use the form post notifications, meant for synchronous mode, to update an indeterminate progress bar. Mandeep didn't seem to be able to reproduce it after that. Another work-around may be to just use a session scoped bean. To make this less likely to happen, and also for backwards compatibility, we should probably do: ICE-3122 : iinputFile selectively post form http://jira.icefaces.org/browse/ICE-3122 But, the real solution will involve investigating how we alter the request Map, and putting protection around that, which we'll use in the UploadServer, around when it tries to access the progressListener bean.
          Ken Fyten made changes -
          Fix Version/s 1.7.2 [ 10130 ]
          Fix Version/s 1.7.1 [ 10122 ]
          Assignee Priority P1
          Affects Version/s 1.7 [ 10080 ]
          Affects Version/s 1.7.1 [ 10122 ]
          Security Private [ 10001 ]
          Assignee Mark Collette [ mark.collette ]
          Hide
          Neil Griffin added a comment -

          This affects the sample-jsf-icefaces-portlet for Liferay too.

          Show
          Neil Griffin added a comment - This affects the sample-jsf-icefaces-portlet for Liferay too.
          Hide
          Neil Griffin added a comment -

          Changing the bean to session scope only works for the first upload. Upon the second and third upload, it starts to fail again.

          Show
          Neil Griffin added a comment - Changing the bean to session scope only works for the first upload. Upon the second and third upload, it starts to fail again.
          Hide
          User Ansel1 added a comment -

          We've also been seeing this intermittently in 1.7.1, and with a session scoped bean (not a request scoped bean).

          We've actually run into a similiar problem in our own code. We run some UI processes on separate threads, and those are given access to the same FacesContext as the request thread that spawned them. We occasionally ran into the same exception when those background threads tried to lookup managed beans. We've been able to avoid them for quite a while now by doing a simply retry: If we retry evaluating the EL expression to get the managed bean a couple times, we do eventually get it, but we haven't been able to track down the root cause of it.

          Show
          User Ansel1 added a comment - We've also been seeing this intermittently in 1.7.1, and with a session scoped bean (not a request scoped bean). We've actually run into a similiar problem in our own code. We run some UI processes on separate threads, and those are given access to the same FacesContext as the request thread that spawned them. We occasionally ran into the same exception when those background threads tried to lookup managed beans. We've been able to avoid them for quite a while now by doing a simply retry: If we retry evaluating the EL expression to get the managed bean a couple times, we do eventually get it, but we haven't been able to track down the root cause of it.
          Ken Fyten made changes -
          Fix Version/s 1.8DR#2 [ 10142 ]
          Fix Version/s 1.7.2 [ 10130 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #17608 Thu Sep 18 13:46:37 MDT 2008 mark.collette ICE-3187
          ICE-3235 : inputFile missing final render
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/xmlhttp/PersistentFacesState.java
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/inputfile/InputFile.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/component/FileUploadComponent.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/UploadServer.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #17609 Thu Sep 18 13:51:38 MDT 2008 mark.collette ICE-3187 : File upload fails randomly
          ICE-3235 : inputFile missing final render
          Files Changed
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component/src/com/icesoft/faces/component/inputfile/InputFile.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/component/FileUploadComponent.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/webapp/http/core/UploadServer.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/webapp/xmlhttp/PersistentFacesState.java
          Hide
          Mark Collette added a comment -

          I committed the fixes for ICE-3187 and ICE-3235 together.

          The UploadServer now participates in locking that the PersistentFacesState uses to keep concurrent lifecycles from happening. The goal being that, when the lifecycle manages the request map, the InputFile's access of the progressListener bean will no longer coincide, so we shouldn't have the race condition of the progressListener sporadically being inaccessible.

          TRUNK
          Subversion 17608
          ICEfaces 1.7 branch
          Subversion 17609
          icefaces\component\src\com\icesoft\faces\component\inputfile\InputFile.java
          icefaces\core\src\com\icesoft\faces\component\FileUploadComponent.java
          icefaces\core\src\com\icesoft\faces\webapp\http\core\UploadServer.java
          icefaces\core\src\com\icesoft\faces\webapp\xmlhttp\PersistentFacesState.java

          Show
          Mark Collette added a comment - I committed the fixes for ICE-3187 and ICE-3235 together. The UploadServer now participates in locking that the PersistentFacesState uses to keep concurrent lifecycles from happening. The goal being that, when the lifecycle manages the request map, the InputFile's access of the progressListener bean will no longer coincide, so we shouldn't have the race condition of the progressListener sporadically being inaccessible. TRUNK Subversion 17608 ICEfaces 1.7 branch Subversion 17609 icefaces\component\src\com\icesoft\faces\component\inputfile\InputFile.java icefaces\core\src\com\icesoft\faces\component\FileUploadComponent.java icefaces\core\src\com\icesoft\faces\webapp\http\core\UploadServer.java icefaces\core\src\com\icesoft\faces\webapp\xmlhttp\PersistentFacesState.java
          Mark Collette made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Mark Collette made changes -
          Fix Version/s 1.7.2 [ 10130 ]
          Fix Version/s 1.8DR#2 [ 10142 ]
          Assignee Mark Collette [ mark.collette ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #17657 Fri Sep 26 11:44:45 MDT 2008 mark.collette ICE-3187 : File upload fails randomly
          Files Changed
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/component/src/com/icesoft/faces/component/inputfile/InputFile.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/component/FileUploadComponent.java
          Commit graph MODIFY /icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/webapp/http/core/UploadServer.java
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #17658 Fri Sep 26 11:48:45 MDT 2008 mark.collette ICE-3187 : File upload fails randomly
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/inputfile/InputFile.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/component/FileUploadComponent.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/http/core/UploadServer.java
          Hide
          Mark Collette added a comment -

          Added more of the locking protection, to wrap all accesses to the bean, via the file value binding, the progressListener method binding, and the action and actionListener method bindings.

          TRUNK
          Subversion 17658
          ICEfaces 1.7 branch
          Subversion 17657
          icefaces\component\src\com\icesoft\faces\component\inputfile\InputFile.java
          icefaces\core\src\com\icesoft\faces\component\FileUploadComponent.java
          icefaces\core\src\com\icesoft\faces\webapp\http\core\UploadServer.java

          Show
          Mark Collette added a comment - Added more of the locking protection, to wrap all accesses to the bean, via the file value binding, the progressListener method binding, and the action and actionListener method bindings. TRUNK Subversion 17658 ICEfaces 1.7 branch Subversion 17657 icefaces\component\src\com\icesoft\faces\component\inputfile\InputFile.java icefaces\core\src\com\icesoft\faces\component\FileUploadComponent.java icefaces\core\src\com\icesoft\faces\webapp\http\core\UploadServer.java
          Ken Fyten made changes -
          Link This issue blocks ICE-3123 [ ICE-3123 ]
          Ken Fyten made changes -
          Link This issue blocks ICE-3207 [ ICE-3207 ]
          Ken Fyten made changes -
          Link This issue blocks ICE-2499 [ ICE-2499 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Mark Collette [ mark.collette ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Mandeep Hayher
            • Votes:
              13 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: