Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.3
-
Fix Version/s: EE-4.0.0.GA, 4.1
-
Component/s: ACE-Components
-
Labels:None
-
Environment:Icefaces 3.3 from trunk
-
Assignee Priority:P1
Description
Breakpoint on FileEntryFormSubmit.processEvent() amazingly show this method is called 6-9 times on pages also on pages without ace:fileEntry included?
-
- fileEntry-myfaces.PNG
- 38 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
No performance problems now but it seems to be strange. This is pure Icefaces app with one Ace component enabled. Breakpoint stops at FileEntryFormSubmit.processEvent() on page load/rendering phase also on page without ace:fileEntry.
There are only one common setting for all pages:
<context-param>
<param-name>org.icefaces.mandatoryResourceConfiguration</param-name>
<param-value>fileEntry</param-value>
</context-param>
Assigned to Mircea to investigate if this can be optimized so the listener does nothing when no fileEntry comps are present in the form.
Of course, checking for the component in the form might be more expensive than running this listener, but see what you can do with it.
Modified FileEntryFormSubmit listener to process only the addition of FileEntry to the component tree event. Now the listener is invoked once per JSF lifecycle and not invoked when component is not present in the page.
Tested with ICEfaces 4 trunk r43926. Added test application /ICE-9121.jsf to:
http://dev.icesoft.com/svn/repo/qa/trunk/Regression-Icefaces4/Sparkle/Nightly/fileEntry.
Fix is working however I found regressions in 2 other test applications, FileEntry Attribute Test and FileEntry - Action Navigation (ICE-8225). Tested with the revision directly before the fix for ICE-9121. No issues until after the fix. In these 2 test apps the page will not load.
HTTP Status 500 - Component ID tabindexFrm:ice_fileEntry_encodedURL has already been found in the view.
type Exception report
message Component ID tabindexFrm:ice_fileEntry_encodedURL has already been found in the view.
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Component ID tabindexFrm:ice_fileEntry_encodedURL has already been found in the view.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
root cause
java.lang.IllegalStateException: Component ID tabindexFrm:ice_fileEntry_encodedURL has already been found in the view.
com.sun.faces.util.Util.checkIdUniqueness(Util.java:987)
com.sun.faces.util.Util.checkIdUniqueness(Util.java:971)
com.sun.faces.util.Util.checkIdUniqueness(Util.java:971)
com.sun.faces.application.view.FaceletPartialStateManagementStrategy.saveView(FaceletPartialStateManagementStrategy.java:461)
com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:89)
javax.faces.application.StateManager.getViewState(StateManager.java:593)
org.icefaces.ace.component.fileentry.FileEntryFormSubmit$1.encodeBegin(FileEntryFormSubmit.java:108)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854)
javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
org.icefaces.impl.renderkit.RendererWrapper.encodeChildren(RendererWrapper.java:49)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
Prefixed IDs of dynamically added components with parent's ID to avoid duplicate IDs in the component tree. Also fixed lookup of progress bar div in fileEntry.js.
Verified ICEfaces 4 trunk r43938. Tomcat 7, IE 11, FF 34, Chrome 39.
Thanks for response.
You can join this issue with ICE-10060 - old duplicate id patch used by us.
Sorry.But your last patches fails in real app.
Last stable change was 43553.
After this we notice never ended loop on file submit with log
sty 27, 2015 1:41:43 PM org.icefaces.impl.event.CheckComponentID processEvent WARNING: Component org.icefaces.ace.component.pushbutton.PushButton uses the 'submit' string for the ID attribute. This is known to cause problems i n Internet Explorer. sty 27, 2015 1:41:43 PM org.icefaces.impl.event.CheckComponentID processEvent WARNING: Component org.icefaces.ace.component.pushbutton.PushButton uses the 'submit' string for the ID attribute. This is known to cause problems i n Internet Explorer. sty 27, 2015 1:41:43 PM org.icefaces.impl.event.CheckComponentID processEvent WARNING: Component org.icefaces.ace.component.pushbutton.PushButton uses the 'submit' string for the ID attribute. This is known to cause problems i n Internet Explorer. sty 27, 2015 1:41:43 PM org.icefaces.impl.event.CheckComponentID processEvent WARNING: Component org.icefaces.ace.component.pushbutton.PushButton uses the 'submit' string for the ID attribute. This is known to cause problems i n Internet Explorer. sty 27, 2015 1:41:43 PM org.icefaces.impl.event.CheckComponentID processEvent WARNING: Component org.icefaces.ace.component.pushbutton.PushButton uses the 'submit' string for the ID attribute. This is known to cause problems i n Internet Explorer. sty 27, 2015 1:41:43 PM org.icefaces.impl.event.CheckComponentID processEvent WARNING: Component org.icefaces.ace.component.pushbutton.PushButton uses the 'submit' string for the ID attribute. This is known to cause problems i n Internet Explorer. sty 27, 2015 1:41:43 PM org.icefaces.impl.event.CheckComponentID processEvent WARNING: Component org.icefaces.ace.component.pushbutton.PushButton uses the 'submit' string for the ID attribute. This is known to cause problems i
Environment: Myfaces 2.2.7 and org.icefaces.subtreeDiff=false
Tested with ICEfaces 4 trunk r43974 using myfaces 2.2.5 bundle on Tomcat 7. I can confirm that the loop issue occurs when using myfaces libs. This happens whether or not org.icefaces.subtreeDiff= true or false. This is not an issue with mojarra libs.
Register FileEntryFormSubmit listener in faces-config.xml instead of doing it programmaticaly from FileEntryLoader bean. Fire FileEntryFormSubmit listener when enclosing form is added to component tree to avoid triggering infinite loop in Myfaces.
Re-opening because of regressions in showcase > ace:fileEntry on IF4 trunk rev. 43997, all browsers.
These issues don't exist on IF4 trunk rev. 43987 (before changes for this JIRA).
> Overview: files are uploaded, however the Overview demo page fails to render the uploaded files on server.
> Listener: non-PDF files should not be allowed to upload, however they can be uploaded on server; also, there is no warning message when trying to upload non-PDF files.
> Validation: files larger than the selected max. file size are not uploaded on the server, however the feedback message fails to render the validation failure, instead they render the name of the
selected file for upload, as it would have been uploaded.
> Callback: this demo should not allow PDF files uploads; selecting a PDF file for upload fails to trigger an error message, instead it renders the name of the PDF files.
Please re-test with the latest IF4 (also make sure to create a clean build) since all the problems mentioned in previous comments do not show up.
Tested with ICEfaces 4 trunk r 44025 using a clean showcase build with mojarra libs and Tomcat 7. I can confirm that the following issues are still occurring.
> Overview: files are uploaded, however the Overview demo page fails to render the uploaded files on server.
> Listener: non-PDF files should not be allowed to upload, however they can be uploaded on server; also, there is no warning message when trying to upload non-PDF files.
> Validation: files larger than the selected max. file size are not uploaded on the server, however the feedback message fails to render the validation failure, instead they render the name of the
selected file for upload, as it would have been uploaded.
> Callback: this demo should not allow PDF files uploads; selecting a PDF file for upload fails to trigger an error message, instead it renders the name of the PDF files.
Tested with ICEfaces 4 trunk r 44025 using a clean showcase build with myfaces libs and Tomcat 7. I am not able to verify the previous fix for myfaces infinite loop because clicking on any link in showcase results in a runtime exception:
java.lang.RuntimeException: The partial submit does not contain javax.faces.View
State key.
at org.icefaces.impl.context.DOMPartialRenderCallback.visit(DOMPartialVi
ewContext.java:817)
at org.apache.myfaces.component.visit.PartialVisitContext.invokeVisitCal
lback(PartialVisitContext.java:213)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1016)
at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:
1191)
at javax.faces.component.UIForm.visitTree(UIForm.java:345)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1044)
at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:
1191)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1044)
at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:
1191)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1044)
at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:
1191)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1044)
at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:
1191)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1044)
at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:
1191)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1044)
at javax.faces.component.UIComponentBase.visitTree(UIComponentBase.java:
1191)
at org.icefaces.impl.context.DOMPartialViewContext.renderSubtrees(DOMPar
tialViewContext.java:502)
at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPar
tialViewContext.java:187)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialV
iewContextWrapper.java:85)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:516)
at javax.faces.component.UIComponentBase.encodeAll(UIComponentBase.java:
541)
at org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage.rende
rView(FaceletViewDeclarationLanguage.java:1891)
at org.apache.myfaces.application.ViewHandlerImpl.renderView(ViewHandler
Impl.java:313)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrap
per.java:58)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderRes
ponseExecutor.java:116)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:
267)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:200)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
torBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp
11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(
AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoin
t.java:1852)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
at java.lang.Thread.run(Thread.java:745)
This last problem is not related at all to the current issue, it is a regression that was most probably introduced by ICE-10438 fixes.
The fix assigns IDs to the components that trigger the creation of 'head' and 'body' facet containers to avoid interfering with ID generation, in particular for the UIViewRoot since the attached view scope state is not restored properly (UIViewRoot ID used to be different on page load versus post-back).
Tested with ICEfaces 4 trunk r 44040 using a clean showcase build with mojarra libs and Tomcat 7. I can confirm that the following issues are still occurring.
> Overview: files are uploaded, however the Overview demo page fails to render the uploaded files on server.
> Listener: non-PDF files should not be allowed to upload, however they can be uploaded on server; also, there is no warning message when trying to upload non-PDF files.
> Validation: files larger than the selected max. file size are not uploaded on the server, however the feedback message fails to render the validation failure, instead they render the name of the
selected file for upload, as it would have been uploaded.
> Callback: this demo should not allow PDF files uploads; selecting a PDF file for upload fails to trigger an error message, instead it renders the name of the PDF files.
Tested with ICEfaces 4 trunk r44044. Found additional issues with fileEntry when using myfaces libs.
1.)fileEntry > Listener - When uploading a .pdf file (the only file type which should be allowed) the demo is redirected back to the showcase > Overview page.
2.)fileEntry > Callback - When uploading a .pdf file (should not be allowed) the demo is redirected back to the showcase > Overview page.
Neither of these issues occur when using mojarra libs.
Added back FileEntryLoader class to register FileEntryPhaseListener on startup. FileEntryPhaseListener is responsible for running the validation phase during an upload.
Introduced view scoped bean that records when beans are disposed first. This is then used to decide if ICEfaces' bean disposal code need to run.
All MyFaces specific issues are still reproducible in showcase on IF4 trunk r.44073.
Wired FileEntryFormSubmit listener for form pre-render events to ensure that FileEntry can be found among the grand/children of the form. Previously the listener was executed on form post-add to view events with the condition of finding the FileEntry component among the children, but of course there are cases where the FileEntry is not yet in the tree at that time.
Modified ice.ace.fileentry.cancelFileSelection function to clone the submitting element and avoid serializing the included input[type=file] elements. This ensures that Myfaces will not invalidate the form submit and cause the issued single submit to fail (including the element cleanup it needs to do).
FileEntryFormSubmit is a SystemEventListener that listens for form components being added to the page, on every single lifecycle, and adds javascript to make the form submit work with the fileEntry uploading code, if the form contains any fileEntry components. The more forms on your page, the more this will be called. Is there some performance problem you're experiencing with this?