Details
-
Type: Bug
-
Status: Closed
-
Priority: 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)
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)
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 formhttp://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.