javax.servlet.ServletException: WriteText method cannot write null text
Posted
by
Learner
on Stack Overflow
See other posts from Stack Overflow
or by Learner
Published on 2012-11-16T04:41:11Z
Indexed on
2012/11/19
5:01 UTC
Read the original article
Hit count: 203
jsf
I have created a Web application using JSF+Icefaces+Richfaces+Primefaces.It is working great while I run it from eclipse as a project but When I created its WAR file and deployed in GlassFish Server then while rendering a page it is throwing this exception
javax.servlet.ServletException: WriteText method cannot write null text
I searched but didn't get any good solution.A quick help is highly appreciated
Edit:1
I think this would be the relevant part for this
<li class="page_item" id="liMasterSearch"> <!-- this is for hide (<li class="page_item hide" id="liMasterSearch"> applied to every class) -->
<h:commandLink value="Search" action="#{masterRenderBean.showSimpleSearch}"></h:commandLink>
</li>
<li class="page_item" id="liAdvanceSearch">
<h:commandLink value="Advance Search" action="#{masterRenderBean.showADVS}"></h:commandLink>
</li>
Here you can see two links (1) Search and (2) Advance Search
when I click on Search , It shows search page (By rendering-Actually I have included all pages in masterpage and render them on commandlink functions)
<h:panelGroup rendered="#{not masterRenderBean.simpleSearch}">
<ui:include src="../../WebPages/SearchPages/MasterSearch.xhtml"></ui:include>
</h:panelGroup>
But When I click on Advance Search link (on which this part should render)
<h:panelGroup rendered="#{not masterRenderBean.advs}">
<ui:include src="../../WebPages/SearchPages/PersonalAdvanceSearch.xhtml"/>
</h:panelGroup>
The browser show the above exception.
NOTE: Keep in mind that this problem is occurring in deploying.It is not coming in actual application when I run it from eclipse from code
EDIT:2 I found in server logs that this exception is coming due to acefaces and this portion of code
<ace:autoCompleteEntry id="txtplaceofbirth"
rows="10" autocomplete="false"
minChars="2" width="150"
value="#{inputPersonal.selectedplcofBirth}"
filterMatchMode="none"
valueChangeListener="#{inputPersonal.valueChangeEventCity}">
<f:selectItems value="#{inputPersonal.cities}"/>
</ace:autoCompleteEntry></h:outputFormat>
is messing up.Any idea Why this is hapening?
Edit #3:
Here is the full tack trace of exception
[#|2012-11-19T09:55:48.026+0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=53;_ThreadName=Thread-2;|java.lang.NullPointerException: WriteText method cannot write null text
at org.icefaces.impl.context.DOMResponseWriter.writeText(DOMResponseWriter.java:314)
at org.icefaces.impl.context.DOMResponseWriter.writeText(DOMResponseWriter.java:340)
at com.sun.faces.renderkit.html_basic.OutputMessageRenderer.encodeEnd(OutputMessageRenderer.java:163)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1764)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
at org.icefaces.impl.renderkit.RendererWrapper.encodeChildren(RendererWrapper.java:49)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
at org.icefaces.impl.renderkit.RendererWrapper.encodeChildren(RendererWrapper.java:49)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1760)
at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:142)
at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:981)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1757)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:391)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
|#]
© Stack Overflow or respective owner