voyent
InputFile problem after upgrade to 1.7.2  XML
Forum Index -> Components
Author Message
kontogou

Joined: 08/Jul/2008 00:00:00
Messages: 4
Offline


Hi all,
After upgrading to 1.7.2 I am always getting this Faces Context null exception. The exception occurs when rendering the new state after file upload has succeded, in order to update the progress bar. It worked fine in 1.7.1.
The inputfile component is inside a modal panel popup.

There is another issue in 1.7.2 with fileupload, it reports all files as application/x-download, while 1.7.1 reported correctly eg. application/pdf.


Code:
java.lang.NullPointerException: FacesContext -> null
 	at javax.faces.component.ValueBindingValueExpressionAdapter.getValue(ValueBindingValueExpressionAdapter.java:98)
 	at com.icesoft.faces.component.style.OutputStyle.getHref(OutputStyle.java:87)
 	at com.icesoft.faces.component.inputfile.InputFile.renderIFrame(InputFile.java:341)
 	at com.icesoft.faces.webapp.http.core.UploadServer$2$1.writeTo(UploadServer.java:97)
 	at com.icesoft.faces.webapp.http.common.standard.StreamingContentHandler.respond(StreamingContentHandler.java:24)
 	at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:167)
 	at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet$ThreadBlockingRequestResponse.respondWith(ThreadBlockingAdaptingServlet.java:36)
 	at com.icesoft.faces.webapp.http.core.UploadServer$2.servlet(UploadServer.java:95)
 	at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.detectEnvironment(ServletRequestResponse.java:228)
 	at com.icesoft.faces.webapp.http.core.UploadServer.service(UploadServer.java:50)
 	at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
 	at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:160)
 	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher$1.service(SessionDispatcher.java:38)
 	at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
 	at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:63)
 	at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:55)
 	at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
 	at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:91)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
 	at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:56)
 	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
 	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
 	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
 	at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
 	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
 	at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
 	at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
 	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
 	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
 	at weblogic.security.service.SecurityManager.runAs(Unknown Source)
 	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
 	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
 	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
 	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
 	at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
kontogou

Joined: 08/Jul/2008 00:00:00
Messages: 4
Offline


For an unknown reason the Commons file upload servlet fails and produces a "servlet failed with Exception : " with the quoted exception.
Stacktrace has no reference to my java code, the exception is thrown somewhere from icefaces internal input file handler.

Surprisingly file is uploaded correctly despite the exception, fails only if Asynchronous Http Server and JMS is used.

If I ommit the state.render() statement from the inputFileActionListener, problem is eliminated, but page is not updated and I have to click a button or write something in a field in order to get the file status and the progressbar rendered correctly.

SubmitOnUpload "postUpload" and "preAndPostUpload" don't work either.
kontogou

Joined: 08/Jul/2008 00:00:00
Messages: 4
Offline


Solved after some searching.
Problem caused by the state.render() call in the progress listener of the outputprogress component.
It seems that if you try to render state if file upload fails (invalid file or exceeded file limit) servlet fails.

Instead of using the render.state() call, I changed inputfile property progressRender to "true" and all is working fine.
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team