[ http://jira.jboss.com/jira/browse/JBSEAM-948?page=comments#action_12354949 ]
Christian Bauer commented on JBSEAM-948:
----------------------------------------
You can reproduce this with the wiki example (check the readme.txt first, it's different than other examples). Just upload a file and on the upload screen, enter a name for the file that was already used in the current wiki area (e.g. "Foo" when uploading in the "News" area). This will re-render the page with a JSF validation error but also throw the exception b/c the upload tag is there.
> NPE in Facelets if no redirect after file upload
> ------------------------------------------------
>> Key: JBSEAM-948
> URL: http://jira.jboss.com/jira/browse/JBSEAM-948> Project: JBoss Seam
> Issue Type: Bug
> Components: JSF
> Reporter: Christian Bauer
> Assigned To: Shane Bryzak
> Fix For: 1.2.1.GA
>>> This happens after a file upload action, if we don't redirect but render a page (the seamspace demo is redirecting). It does not matter which page is rendered after the file upload.
> fileEdit.xhtml:
> <h:form enctype="multipart/form-data">
> <s:validateAll>
> <s:decorate>
> <div class="entry">
> <div class="label">Name:</div>
> <div class="input">
> <h:inputText tabindex="1" size="80" maxlength="255" id="name" required="true"
> value="#{fileHome.instance.name}"/>
> </div>
> </div>
> </s:decorate>
> <s:decorate>
> <div class="entry">
> <div class="label">Upload:</div>
> <div class="input">
> <s:fileUpload data="#{fileHome.instance.data}"
> contentType="#{fileHome.instance.contentType}"
> fileName="#{fileHome.instance.filename}"
> fileSize="#{fileHome.instance.filesize}"/>
> </div>
> </div>
> </s:decorate>
> ...
> FileHome is just a Home<File> subclass, nothing interesting. When I submit this form, the upload is done and the home.persist() method completes OK (I have everything in the database). The render response, which is fileEdit.xhtml again, fails with this:
> java.lang.NullPointerException
> at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:168)
> at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:144)
> at com.sun.facelets.util.DevTools.debugHtml(DevTools.java:109)
> at com.sun.facelets.FaceletViewHandler.handleRenderException(FaceletViewHandler.java:671)
> at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:639)
> at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:130)
> at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
> at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
> at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
> at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
> at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
> at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
> at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
> at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:74)
> at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
> at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
> at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
> at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
> at java.lang.Thread.run(Thread.java:613)
> Looks like there is a problem rendering the view and then an NPE in Facelets which hides the error.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira