You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Novin <no...@ml.com> on 2007/06/27 20:36:20 UTC
Problem in Tree2: nullpointer
org.apache.myfaces.custom.tree2.UITreeData.encodeEnd
Hi freinds,
I have implemented tamhalk tree2, Initially it was working fine but now It
is throwing nullpointer when treis to render the tree.
Pls help me. here is the JSP page code for the tree to be displayed and
stack trace of the exception.
Does any one have any idea?
Here is the faces config file.
http://www.nabble.com/file/p11330136/faces-config.xml faces-config.xml
Thanks and Regards,
Novin Jaiswal
<f:subview id="accounttreesubview">
<a4j:region>
<a4j:outputPanel ajaxRendered="true">
<h:messages/>
</a4j:outputPanel>
<h:form id="frmAccountGrpupUpdate">
<a4j:outputPanel id="accountTreePanel">
<t:tree2 id="clientTree" value="#{accountTreeBean.treeData}"
var="node" varNodeToggler="t" >
<f:facet name="person" >
<h:panelGroup id="grp1">
<h:outputText value="#{node.description}" id="temp3"/>
</h:panelGroup>
</f:facet>
<f:facet name="foo-folder">
<h:panelGroup id="grp2">
<h:outputText value="#{node.description}" id="temp7"/>
</h:panelGroup>
</f:facet>
<f:facet name="document">
<h:panelGroup id="grp3">
<h:outputText value="#{node.description}"
id="temp11"/>
</h:panelGroup>
</f:facet>
</t:tree2>
</a4j:outputPanel>
</h:form>
</a4j:region>
</f:subview>
SRVE0068E: Uncaught exception thrown in one of the service methods of the
servlet: /pages/csin/tiles/account/accountTree.jsp. Exception thrown :
java.lang.NullPointerException
at
org.apache.myfaces.custom.tree2.UITreeData.encodeEnd(UITreeData.java:120)
at
org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
at
org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
at
org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:735)
at
org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:282)
at
org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
at
org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:284)
at
org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
at
org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeChildren(AjaxContainerRenderer.java:100)
at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:735)
at org.ajax4jsf.ajax.UIAjaxRegion.encodeChildren(UIAjaxRegion.java:117)
at
javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:611)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:548)
at com.ibm._jsp._accountTree._jspx_meth_a4j_region_0(_accountTree.java:448)
at com.ibm._jsp._accountTree._jspx_meth_f_subview_0(_accountTree.java:468)
at com.ibm._jsp._accountTree._jspService(_accountTree.java:93)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at
com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)
at
com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)
at
com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:270)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:606)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:1034)
at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:484)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
at
com.ibm._jsp._commonLayout._jspx_meth_tiles_insert_3(_commonLayout.java:212)
at com.ibm._jsp._commonLayout._jspx_meth_f_view_0(_commonLayout.java:264)
at com.ibm._jsp._commonLayout._jspService(_commonLayout.java:131)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at
com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)
at
com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)
at
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:325)
at
org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:236)
at
org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:222)
at
org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
at
org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
at
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
at
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
at
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
at
com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
--
View this message in context: http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11330136
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Problem in Tree2: nullpointer org.apache.myfaces.custom.tree2.UITreeData.encodeEnd
Posted by Andrew Robinson <an...@gmail.com>.
<a4j:region id="treeRegion">
<t:tree2 var="_node" value="...">
<f:facet name="node">
<a4j:commandLink value="#{_node.identifier}"
ajaxSingle="true" reRender="listboxRegion">
<t:updateActionListener
property="#{bean.selectedNodeId}"
value="#{_node.identifier}" />
</a4j:commandLink>
</f:facet>
</t:tree2>
</a4j:region>
<a4j:outputPanel id="listboxRegion">
...
</a4j:outputPanel>
On 6/28/07, Novin <no...@ml.com> wrote:
>
> Hi Andrew,
>
> Thanks a lot for such a fine and comprehensive reply I ever have on any
> forum.
>
> Ya you are right with all those points related to Action approach.
>
> Now I have implemented backing bean based approach and also used
>
> <t:saveState value="#{accountTreeBean}"/> its working fine instead of
> storing the bean into request session.
>
> Do u have any idea related to this problem:
> It is not related to Tree but related to ajax4JSF.
>
> On click of tree node I want to fire some ajax request but I donot want the
> same tree to be rerender.
>
> The jsp page is having two regions one for tree & one for ListBox.
>
> Wht I want : on click of the tree 's any node. I want only rerender the
> ListBox region and want to fire some action event.
>
> Wht is happening:
> But currently when I click on the tree node for the new request (which is
> inside tree region )
> It load the whole tree from the bean which I need to put the bean into the
> session.
>
> <managed-bean>
> <managed-bean-name>accountTreeBean</managed-bean-name>
>
> <managed-bean-class>com.ml.ffogo.csin.web.beans.AccountTreeBean</managed-bean-class>
> <managed-bean-scope>session</managed-bean-scope>
> </managed-bean>
>
> I don't want to rerender the tree region but only want to send the req and
> re-render the listbox region.
>
> Novin
>
>
>
>
>
>
> Andrew Robinson-5 wrote:
> >
> > I don't see a problem with the action based, it isn't my style
> > however, as I prefer to have my data directly tied to managed bean
> > member variables. That way I can really get a controller role for an
> > MVC style of development. It also is more "JSF" to me and less
> > servlet-JSP style of development.
> >
> > I use quite a bit of on-load type of functionality, because I can
> > ensure that if the user navigates to a page without going through the
> > action, I can make sure all the data for a page is loaded. I use
> > JBoss-Seam to manage on-load actions, but I have also developed the
> > jsf-comp on-load component that works well if you only want that
> > functionality without a large 3rd party library.
> >
> > Also, it is easier to debug a bean than to debug the servlet and
> > session scopes.
> >
> > With that said, either way really should work for you. If you go with
> > your action based approach, you have to make sure that the tree
> > component is never created and especially rendered unless the action
> > fires first, otherwise you will have errors.
> >
> > If you use a bean, you can make it serve all the needs of you page,
> > and not just the tree. Also, with the t:saveState, you can make sure
> > the bean's data will be saved request to request. That way, the tree
> > model will be still available if you submit another control.
> >
> > What the problem may be is that you are creating the data model in the
> > action, the tree is displayed, and then when you run an action on that
> > page the data model is gone since it is only around for one request.
> >
> > If you want to use the action based method, try using:
> >
> > <t:saveState value="#{request.attributes['treeData']}" />
> >
> > Replace the EL with where ever you are sticking the tree model. Also,
> > in your initial post, you have the tree pointing at
> > #{accountTreeBean.treeData} not #{request.something}.
> >
> > -Andrew
> >
> > On 6/28/07, Novin <no...@ml.com> wrote:
> >>
> >> Hi Andrew,
> >>
> >> My problem of dispaying the tree is solved.
> >>
> >> As per your last reply I can adopt two different approach
> >>
> >> 1) on-load functionality or Managed bean based (when the page will be
> >> load)
> >> the treetable bean's treedata method will called and treenode will
> >> begenerated and displayed.
> >>
> >> 2) action based : where I am calling an action and setting the treebean
> >> into
> >> the request and when JSP page is loaded I am just fetching the bean from
> >> the
> >> request(which is already created in the action.)
> >>
> >> I have choosen Action based approach bcas I need to display some more
> >> data
> >> on the same page along with the tree. On change of the listbox I need to
> >> fire some method calls.
> >>
> >> So to make all the logic centralised I choosed action based approach.
> >>
> >> I am attaching the screenshot of the page.
> >>
> >> If you have any better idea pls let me know.
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11351385
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>
Re: Problem in Tree2: nullpointer
org.apache.myfaces.custom.tree2.UITreeData.encodeEnd
Posted by Novin <no...@ml.com>.
Hi Andrew,
Thanks a lot for such a fine and comprehensive reply I ever have on any
forum.
Ya you are right with all those points related to Action approach.
Now I have implemented backing bean based approach and also used
<t:saveState value="#{accountTreeBean}"/> its working fine instead of
storing the bean into request session.
Do u have any idea related to this problem:
It is not related to Tree but related to ajax4JSF.
On click of tree node I want to fire some ajax request but I donot want the
same tree to be rerender.
The jsp page is having two regions one for tree & one for ListBox.
Wht I want : on click of the tree 's any node. I want only rerender the
ListBox region and want to fire some action event.
Wht is happening:
But currently when I click on the tree node for the new request (which is
inside tree region )
It load the whole tree from the bean which I need to put the bean into the
session.
<managed-bean>
<managed-bean-name>accountTreeBean</managed-bean-name>
<managed-bean-class>com.ml.ffogo.csin.web.beans.AccountTreeBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
I don't want to rerender the tree region but only want to send the req and
re-render the listbox region.
Novin
Andrew Robinson-5 wrote:
>
> I don't see a problem with the action based, it isn't my style
> however, as I prefer to have my data directly tied to managed bean
> member variables. That way I can really get a controller role for an
> MVC style of development. It also is more "JSF" to me and less
> servlet-JSP style of development.
>
> I use quite a bit of on-load type of functionality, because I can
> ensure that if the user navigates to a page without going through the
> action, I can make sure all the data for a page is loaded. I use
> JBoss-Seam to manage on-load actions, but I have also developed the
> jsf-comp on-load component that works well if you only want that
> functionality without a large 3rd party library.
>
> Also, it is easier to debug a bean than to debug the servlet and
> session scopes.
>
> With that said, either way really should work for you. If you go with
> your action based approach, you have to make sure that the tree
> component is never created and especially rendered unless the action
> fires first, otherwise you will have errors.
>
> If you use a bean, you can make it serve all the needs of you page,
> and not just the tree. Also, with the t:saveState, you can make sure
> the bean's data will be saved request to request. That way, the tree
> model will be still available if you submit another control.
>
> What the problem may be is that you are creating the data model in the
> action, the tree is displayed, and then when you run an action on that
> page the data model is gone since it is only around for one request.
>
> If you want to use the action based method, try using:
>
> <t:saveState value="#{request.attributes['treeData']}" />
>
> Replace the EL with where ever you are sticking the tree model. Also,
> in your initial post, you have the tree pointing at
> #{accountTreeBean.treeData} not #{request.something}.
>
> -Andrew
>
> On 6/28/07, Novin <no...@ml.com> wrote:
>>
>> Hi Andrew,
>>
>> My problem of dispaying the tree is solved.
>>
>> As per your last reply I can adopt two different approach
>>
>> 1) on-load functionality or Managed bean based (when the page will be
>> load)
>> the treetable bean's treedata method will called and treenode will
>> begenerated and displayed.
>>
>> 2) action based : where I am calling an action and setting the treebean
>> into
>> the request and when JSP page is loaded I am just fetching the bean from
>> the
>> request(which is already created in the action.)
>>
>> I have choosen Action based approach bcas I need to display some more
>> data
>> on the same page along with the tree. On change of the listbox I need to
>> fire some method calls.
>>
>> So to make all the logic centralised I choosed action based approach.
>>
>> I am attaching the screenshot of the page.
>>
>> If you have any better idea pls let me know.
>
>
--
View this message in context: http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11351385
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Problem in Tree2: nullpointer org.apache.myfaces.custom.tree2.UITreeData.encodeEnd
Posted by Andrew Robinson <an...@gmail.com>.
I don't see a problem with the action based, it isn't my style
however, as I prefer to have my data directly tied to managed bean
member variables. That way I can really get a controller role for an
MVC style of development. It also is more "JSF" to me and less
servlet-JSP style of development.
I use quite a bit of on-load type of functionality, because I can
ensure that if the user navigates to a page without going through the
action, I can make sure all the data for a page is loaded. I use
JBoss-Seam to manage on-load actions, but I have also developed the
jsf-comp on-load component that works well if you only want that
functionality without a large 3rd party library.
Also, it is easier to debug a bean than to debug the servlet and
session scopes.
With that said, either way really should work for you. If you go with
your action based approach, you have to make sure that the tree
component is never created and especially rendered unless the action
fires first, otherwise you will have errors.
If you use a bean, you can make it serve all the needs of you page,
and not just the tree. Also, with the t:saveState, you can make sure
the bean's data will be saved request to request. That way, the tree
model will be still available if you submit another control.
What the problem may be is that you are creating the data model in the
action, the tree is displayed, and then when you run an action on that
page the data model is gone since it is only around for one request.
If you want to use the action based method, try using:
<t:saveState value="#{request.attributes['treeData']}" />
Replace the EL with where ever you are sticking the tree model. Also,
in your initial post, you have the tree pointing at
#{accountTreeBean.treeData} not #{request.something}.
-Andrew
On 6/28/07, Novin <no...@ml.com> wrote:
>
> Hi Andrew,
>
> My problem of dispaying the tree is solved.
>
> As per your last reply I can adopt two different approach
>
> 1) on-load functionality or Managed bean based (when the page will be load)
> the treetable bean's treedata method will called and treenode will
> begenerated and displayed.
>
> 2) action based : where I am calling an action and setting the treebean into
> the request and when JSP page is loaded I am just fetching the bean from the
> request(which is already created in the action.)
>
> I have choosen Action based approach bcas I need to display some more data
> on the same page along with the tree. On change of the listbox I need to
> fire some method calls.
>
> So to make all the logic centralised I choosed action based approach.
>
> I am attaching the screenshot of the page.
>
> If you have any better idea pls let me know.
Re: Problem in Tree2: nullpointer
org.apache.myfaces.custom.tree2.UITreeData.encodeEnd
Posted by Novin <no...@ml.com>.
Hi Andrew,
My problem of dispaying the tree is solved.
As per your last reply I can adopt two different approach
1) on-load functionality or Managed bean based (when the page will be load)
the treetable bean's treedata method will called and treenode will
begenerated and displayed.
2) action based : where I am calling an action and setting the treebean into
the request and when JSP page is loaded I am just fetching the bean from the
request(which is already created in the action.)
I have choosen Action based approach bcas I need to display some more data
on the same page along with the tree. On change of the listbox I need to
fire some method calls.
So to make all the logic centralised I choosed action based approach.
I am attaching the screenshot of the page.
If you have any better idea pls let me know.
Novin
Andrew Robinson-5 wrote:
>
> I'm not sure what you are asking. Are you having a problem with
> displaying the tree before an action method is called?
>
> The bean will be created first time it is evaluated by the EL engine.
> What is your application flow (for example, are you navigating to the
> page with the tree with an action)?
>
> If the user can just "happen" upon the page (bookmark, link, etc),
> then you may want an on-load functionality rather than an action based
> functionality to load the tree model. You can also create the tree
> model from inside the get property method.
>
> See if you can send us some more information then perhaps I can give
> you better advise.
>
> -Andrew
>
> On 6/28/07, Novin <no...@ml.com> wrote:
>>
>> Hi Andrew,
>>
>> Thanks for your help.
>>
>> You are right the problem is with the treedata. It was null and while
>>
>> <t:tree2 id="clientTree" value="#{accountTreeBean.treeData}"
>>
>> accountTreeBean.treeData method was throwing nullpointer exception. Bcas
>> I
>> was not setting the the accountTreeBean in request which now I am doing
>> explicitly in one of my action class which take cares of tree creation by
>> calling accountTreeBean.createTree().
>>
>>
>> And my managed bean "accountTreeBean" entry will not make any difference
>> bcas I m calling action class method to bring that tree.
>>
>> <managed-bean>
>> <managed-bean-name>accountTreeBean</managed-bean-name>
>>
>> <managed-bean-class>com.ml.ffogo.csin.web.beans.AccountTreeBean</managed-bean-class>
>> <managed-bean-scope>request</managed-bean-scope>
>> </managed-bean>
>>
>>
>> Hope you understand my problem and thanks alot for your valuable time.
>>
>> Regards,
>> Novin
>>
>>
>>
>> Andrew Robinson-5 wrote:
>> >
>> > I don't think this is the problem, but I don't think you want the
>> > a4j:region outside of the form.
>> >
>> > As for the exception, that would occur if the tree data model is null.
>> > Here is the line:
>> >
>> > TreeState state = getDataModel().getTreeState();
>> >
>> > On 6/27/07, Novin <no...@ml.com> wrote:
>> >>
>> >> Hi freinds,
>> >>
>> >> I have implemented tamhalk tree2, Initially it was working fine but
>> now
>> >> It
>> >> is throwing nullpointer when treis to render the tree.
>> >>
>> >> Pls help me. here is the JSP page code for the tree to be displayed
>> and
>> >> stack trace of the exception.
>> >>
>> >> Does any one have any idea?
>> >>
>> >> Here is the faces config file.
>> >> http://www.nabble.com/file/p11330136/faces-config.xml faces-config.xml
>> >>
>> >>
>> >> Thanks and Regards,
>> >> Novin Jaiswal
>> >>
>> >> <f:subview id="accounttreesubview">
>> >> <a4j:region>
>> >> <a4j:outputPanel ajaxRendered="true">
>> >> <h:messages/>
>> >> </a4j:outputPanel>
>> >> <h:form id="frmAccountGrpupUpdate">
>> >> <a4j:outputPanel
>> >> id="accountTreePanel">
>> >> <t:tree2 id="clientTree"
>> >> value="#{accountTreeBean.treeData}"
>> >> var="node" varNodeToggler="t" >
>> >> <f:facet name="person"
>> >
>> >> <h:panelGroup
>> >> id="grp1">
>> >> <h:outputText
>> >> value="#{node.description}" id="temp3"/>
>> >> </h:panelGroup>
>> >> </f:facet>
>> >>
>> >> <f:facet
>> >> name="foo-folder">
>> >> <h:panelGroup
>> >> id="grp2">
>> >> <h:outputText
>> >> value="#{node.description}" id="temp7"/>
>> >> </h:panelGroup>
>> >> </f:facet>
>> >>
>> >> <f:facet
>> name="document">
>> >> <h:panelGroup
>> >> id="grp3">
>> >>
>> <h:outputText
>> >> value="#{node.description}"
>> >> id="temp11"/>
>> >> </h:panelGroup>
>> >> </f:facet>
>> >> </t:tree2>
>> >> </a4j:outputPanel>
>> >> </h:form>
>> >> </a4j:region>
>> >> </f:subview>
>> >>
>> >>
>> >>
>> >> SRVE0068E: Uncaught exception thrown in one of the service methods of
>> >> the
>> >> servlet: /pages/csin/tiles/account/accountTree.jsp. Exception thrown :
>> >> java.lang.NullPointerException
>> >> at
>> >>
>> org.apache.myfaces.custom.tree2.UITreeData.encodeEnd(UITreeData.java:120)
>> >> at
>> >>
>> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
>> >> at
>> >>
>> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
>> >> at
>> >>
>> org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
>> >> at
>> >>
>> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:735)
>> >> at
>> >>
>> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:282)
>> >> at
>> >>
>> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
>> >> at
>> >>
>> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:284)
>> >> at
>> >>
>> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
>> >> at
>> >>
>> org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeChildren(AjaxContainerRenderer.java:100)
>> >> at
>> >>
>> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:735)
>> >> at
>> >> org.ajax4jsf.ajax.UIAjaxRegion.encodeChildren(UIAjaxRegion.java:117)
>> >> at
>> >>
>> javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:611)
>> >> at
>> >> javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:548)
>> >> at
>> >>
>> com.ibm._jsp._accountTree._jspx_meth_a4j_region_0(_accountTree.java:448)
>> >> at
>> >>
>> com.ibm._jsp._accountTree._jspx_meth_f_subview_0(_accountTree.java:468)
>> >> at com.ibm._jsp._accountTree._jspService(_accountTree.java:93)
>> >> at
>> >> com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
>> >> at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
>> >> at
>> >>
>> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
>> >> at
>> >>
>> com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)
>> >> at
>> >>
>> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)
>> >> at
>> >>
>> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:270)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:606)
>> >> at
>> >>
>> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:1034)
>> >> at
>> >>
>> org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:484)
>> >> at
>> >>
>> org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
>> >> at
>> >> org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
>> >> at
>> >> org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
>> >> at
>> >>
>> org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
>> >> at
>> >> org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
>> >> at
>> >>
>> com.ibm._jsp._commonLayout._jspx_meth_tiles_insert_3(_commonLayout.java:212)
>> >> at
>> >> com.ibm._jsp._commonLayout._jspx_meth_f_view_0(_commonLayout.java:264)
>> >> at
>> com.ibm._jsp._commonLayout._jspService(_commonLayout.java:131)
>> >> at
>> >> com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
>> >> at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
>> >> at
>> >>
>> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
>> >> at
>> >>
>> com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)
>> >> at
>> >>
>> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)
>> >> at
>> >>
>> com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:325)
>> >> at
>> >>
>> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:236)
>> >> at
>> >>
>> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:222)
>> >> at
>> >>
>> org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
>> >> at
>> >>
>> org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
>> >> at
>> >>
>> com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
>> >> at
>> >> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
>> >> at
>> >> com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)
>> >> at
>> javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
>> >> at
>> >>
>> org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
>> >> at
>> >>
>> org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
>> >> at
>> >>
>> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
>> >> at
>> >>
>> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
>> >> at
>> >>
>> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
>> >> at
>> >>
>> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
>> >> at
>> >>
>> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
>> >> at
>> >>
>> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
>> >> at
>> >>
>> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
>> >> at
>> >>
>> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
>> >> at
>> >>
>> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
>> >> at
>> >>
>> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
>> >> at
>> >>
>> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
>> >> at
>> >>
>> com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
>> >> at
>> com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>> >> at
>> >> com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
>> >> at
>> >>
>> com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
>> >> at
>> com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
>> >> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11330136
>> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11344658
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
>
>
http://www.nabble.com/file/p11345635/treeview.jpg
http://www.nabble.com/file/p11345635/treeview.JPG treeview.JPG
--
View this message in context: http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11345635
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Problem in Tree2: nullpointer org.apache.myfaces.custom.tree2.UITreeData.encodeEnd
Posted by Andrew Robinson <an...@gmail.com>.
I'm not sure what you are asking. Are you having a problem with
displaying the tree before an action method is called?
The bean will be created first time it is evaluated by the EL engine.
What is your application flow (for example, are you navigating to the
page with the tree with an action)?
If the user can just "happen" upon the page (bookmark, link, etc),
then you may want an on-load functionality rather than an action based
functionality to load the tree model. You can also create the tree
model from inside the get property method.
See if you can send us some more information then perhaps I can give
you better advise.
-Andrew
On 6/28/07, Novin <no...@ml.com> wrote:
>
> Hi Andrew,
>
> Thanks for your help.
>
> You are right the problem is with the treedata. It was null and while
>
> <t:tree2 id="clientTree" value="#{accountTreeBean.treeData}"
>
> accountTreeBean.treeData method was throwing nullpointer exception. Bcas I
> was not setting the the accountTreeBean in request which now I am doing
> explicitly in one of my action class which take cares of tree creation by
> calling accountTreeBean.createTree().
>
>
> And my managed bean "accountTreeBean" entry will not make any difference
> bcas I m calling action class method to bring that tree.
>
> <managed-bean>
> <managed-bean-name>accountTreeBean</managed-bean-name>
>
> <managed-bean-class>com.ml.ffogo.csin.web.beans.AccountTreeBean</managed-bean-class>
> <managed-bean-scope>request</managed-bean-scope>
> </managed-bean>
>
>
> Hope you understand my problem and thanks alot for your valuable time.
>
> Regards,
> Novin
>
>
>
> Andrew Robinson-5 wrote:
> >
> > I don't think this is the problem, but I don't think you want the
> > a4j:region outside of the form.
> >
> > As for the exception, that would occur if the tree data model is null.
> > Here is the line:
> >
> > TreeState state = getDataModel().getTreeState();
> >
> > On 6/27/07, Novin <no...@ml.com> wrote:
> >>
> >> Hi freinds,
> >>
> >> I have implemented tamhalk tree2, Initially it was working fine but now
> >> It
> >> is throwing nullpointer when treis to render the tree.
> >>
> >> Pls help me. here is the JSP page code for the tree to be displayed and
> >> stack trace of the exception.
> >>
> >> Does any one have any idea?
> >>
> >> Here is the faces config file.
> >> http://www.nabble.com/file/p11330136/faces-config.xml faces-config.xml
> >>
> >>
> >> Thanks and Regards,
> >> Novin Jaiswal
> >>
> >> <f:subview id="accounttreesubview">
> >> <a4j:region>
> >> <a4j:outputPanel ajaxRendered="true">
> >> <h:messages/>
> >> </a4j:outputPanel>
> >> <h:form id="frmAccountGrpupUpdate">
> >> <a4j:outputPanel
> >> id="accountTreePanel">
> >> <t:tree2 id="clientTree"
> >> value="#{accountTreeBean.treeData}"
> >> var="node" varNodeToggler="t" >
> >> <f:facet name="person" >
> >> <h:panelGroup
> >> id="grp1">
> >> <h:outputText
> >> value="#{node.description}" id="temp3"/>
> >> </h:panelGroup>
> >> </f:facet>
> >>
> >> <f:facet
> >> name="foo-folder">
> >> <h:panelGroup
> >> id="grp2">
> >> <h:outputText
> >> value="#{node.description}" id="temp7"/>
> >> </h:panelGroup>
> >> </f:facet>
> >>
> >> <f:facet name="document">
> >> <h:panelGroup
> >> id="grp3">
> >> <h:outputText
> >> value="#{node.description}"
> >> id="temp11"/>
> >> </h:panelGroup>
> >> </f:facet>
> >> </t:tree2>
> >> </a4j:outputPanel>
> >> </h:form>
> >> </a4j:region>
> >> </f:subview>
> >>
> >>
> >>
> >> SRVE0068E: Uncaught exception thrown in one of the service methods of
> >> the
> >> servlet: /pages/csin/tiles/account/accountTree.jsp. Exception thrown :
> >> java.lang.NullPointerException
> >> at
> >> org.apache.myfaces.custom.tree2.UITreeData.encodeEnd(UITreeData.java:120)
> >> at
> >> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
> >> at
> >> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
> >> at
> >> org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
> >> at
> >> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:735)
> >> at
> >> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:282)
> >> at
> >> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
> >> at
> >> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:284)
> >> at
> >> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
> >> at
> >> org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeChildren(AjaxContainerRenderer.java:100)
> >> at
> >> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:735)
> >> at
> >> org.ajax4jsf.ajax.UIAjaxRegion.encodeChildren(UIAjaxRegion.java:117)
> >> at
> >> javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:611)
> >> at
> >> javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:548)
> >> at
> >> com.ibm._jsp._accountTree._jspx_meth_a4j_region_0(_accountTree.java:448)
> >> at
> >> com.ibm._jsp._accountTree._jspx_meth_f_subview_0(_accountTree.java:468)
> >> at com.ibm._jsp._accountTree._jspService(_accountTree.java:93)
> >> at
> >> com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> >> at
> >> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
> >> at
> >> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
> >> at
> >> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
> >> at
> >> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
> >> at
> >> com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)
> >> at
> >> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)
> >> at
> >> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:270)
> >> at
> >> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:606)
> >> at
> >> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:1034)
> >> at
> >> org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:484)
> >> at
> >> org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
> >> at
> >> org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
> >> at
> >> org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
> >> at
> >> org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
> >> at
> >> org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
> >> at
> >> com.ibm._jsp._commonLayout._jspx_meth_tiles_insert_3(_commonLayout.java:212)
> >> at
> >> com.ibm._jsp._commonLayout._jspx_meth_f_view_0(_commonLayout.java:264)
> >> at com.ibm._jsp._commonLayout._jspService(_commonLayout.java:131)
> >> at
> >> com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> >> at
> >> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
> >> at
> >> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
> >> at
> >> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
> >> at
> >> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
> >> at
> >> com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)
> >> at
> >> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)
> >> at
> >> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)
> >> at
> >> com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:325)
> >> at
> >> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:236)
> >> at
> >> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:222)
> >> at
> >> org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
> >> at
> >> org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
> >> at
> >> com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
> >> at
> >> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
> >> at
> >> com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)
> >> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
> >> at
> >> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
> >> at
> >> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
> >> at
> >> org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
> >> at
> >> org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
> >> at
> >> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
> >> at
> >> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
> >> at
> >> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
> >> at
> >> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
> >> at
> >> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
> >> at
> >> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
> >> at
> >> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
> >> at
> >> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
> >> at
> >> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
> >> at
> >> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
> >> at
> >> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
> >> at
> >> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
> >> at
> >> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
> >> at
> >> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
> >> at
> >> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
> >> at
> >> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
> >> at
> >> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
> >> at
> >> com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
> >> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> >> at
> >> com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
> >> at
> >> com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
> >> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
> >> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
> >>
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11330136
> >> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11344658
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>
Re: Problem in Tree2: nullpointer
org.apache.myfaces.custom.tree2.UITreeData.encodeEnd
Posted by Novin <no...@ml.com>.
Hi Andrew,
Thanks for your help.
You are right the problem is with the treedata. It was null and while
<t:tree2 id="clientTree" value="#{accountTreeBean.treeData}"
accountTreeBean.treeData method was throwing nullpointer exception. Bcas I
was not setting the the accountTreeBean in request which now I am doing
explicitly in one of my action class which take cares of tree creation by
calling accountTreeBean.createTree().
And my managed bean "accountTreeBean" entry will not make any difference
bcas I m calling action class method to bring that tree.
<managed-bean>
<managed-bean-name>accountTreeBean</managed-bean-name>
<managed-bean-class>com.ml.ffogo.csin.web.beans.AccountTreeBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
Hope you understand my problem and thanks alot for your valuable time.
Regards,
Novin
Andrew Robinson-5 wrote:
>
> I don't think this is the problem, but I don't think you want the
> a4j:region outside of the form.
>
> As for the exception, that would occur if the tree data model is null.
> Here is the line:
>
> TreeState state = getDataModel().getTreeState();
>
> On 6/27/07, Novin <no...@ml.com> wrote:
>>
>> Hi freinds,
>>
>> I have implemented tamhalk tree2, Initially it was working fine but now
>> It
>> is throwing nullpointer when treis to render the tree.
>>
>> Pls help me. here is the JSP page code for the tree to be displayed and
>> stack trace of the exception.
>>
>> Does any one have any idea?
>>
>> Here is the faces config file.
>> http://www.nabble.com/file/p11330136/faces-config.xml faces-config.xml
>>
>>
>> Thanks and Regards,
>> Novin Jaiswal
>>
>> <f:subview id="accounttreesubview">
>> <a4j:region>
>> <a4j:outputPanel ajaxRendered="true">
>> <h:messages/>
>> </a4j:outputPanel>
>> <h:form id="frmAccountGrpupUpdate">
>> <a4j:outputPanel
>> id="accountTreePanel">
>> <t:tree2 id="clientTree"
>> value="#{accountTreeBean.treeData}"
>> var="node" varNodeToggler="t" >
>> <f:facet name="person" >
>> <h:panelGroup
>> id="grp1">
>> <h:outputText
>> value="#{node.description}" id="temp3"/>
>> </h:panelGroup>
>> </f:facet>
>>
>> <f:facet
>> name="foo-folder">
>> <h:panelGroup
>> id="grp2">
>> <h:outputText
>> value="#{node.description}" id="temp7"/>
>> </h:panelGroup>
>> </f:facet>
>>
>> <f:facet name="document">
>> <h:panelGroup
>> id="grp3">
>> <h:outputText
>> value="#{node.description}"
>> id="temp11"/>
>> </h:panelGroup>
>> </f:facet>
>> </t:tree2>
>> </a4j:outputPanel>
>> </h:form>
>> </a4j:region>
>> </f:subview>
>>
>>
>>
>> SRVE0068E: Uncaught exception thrown in one of the service methods of
>> the
>> servlet: /pages/csin/tiles/account/accountTree.jsp. Exception thrown :
>> java.lang.NullPointerException
>> at
>> org.apache.myfaces.custom.tree2.UITreeData.encodeEnd(UITreeData.java:120)
>> at
>> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
>> at
>> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
>> at
>> org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
>> at
>> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:735)
>> at
>> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:282)
>> at
>> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
>> at
>> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:284)
>> at
>> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
>> at
>> org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeChildren(AjaxContainerRenderer.java:100)
>> at
>> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:735)
>> at
>> org.ajax4jsf.ajax.UIAjaxRegion.encodeChildren(UIAjaxRegion.java:117)
>> at
>> javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:611)
>> at
>> javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:548)
>> at
>> com.ibm._jsp._accountTree._jspx_meth_a4j_region_0(_accountTree.java:448)
>> at
>> com.ibm._jsp._accountTree._jspx_meth_f_subview_0(_accountTree.java:468)
>> at com.ibm._jsp._accountTree._jspService(_accountTree.java:93)
>> at
>> com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>> at
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
>> at
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
>> at
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
>> at
>> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
>> at
>> com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)
>> at
>> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)
>> at
>> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:270)
>> at
>> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:606)
>> at
>> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:1034)
>> at
>> org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:484)
>> at
>> org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
>> at
>> org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
>> at
>> org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
>> at
>> org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
>> at
>> org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
>> at
>> com.ibm._jsp._commonLayout._jspx_meth_tiles_insert_3(_commonLayout.java:212)
>> at
>> com.ibm._jsp._commonLayout._jspx_meth_f_view_0(_commonLayout.java:264)
>> at com.ibm._jsp._commonLayout._jspService(_commonLayout.java:131)
>> at
>> com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>> at
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
>> at
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
>> at
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
>> at
>> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
>> at
>> com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)
>> at
>> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)
>> at
>> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)
>> at
>> com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:325)
>> at
>> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:236)
>> at
>> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:222)
>> at
>> org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
>> at
>> org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
>> at
>> com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
>> at
>> com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
>> at
>> com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)
>> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
>> at
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
>> at
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
>> at
>> org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
>> at
>> org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
>> at
>> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
>> at
>> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
>> at
>> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
>> at
>> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
>> at
>> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
>> at
>> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
>> at
>> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
>> at
>> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
>> at
>> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
>> at
>> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
>> at
>> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
>> at
>> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
>> at
>> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
>> at
>> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
>> at
>> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
>> at
>> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
>> at
>> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
>> at
>> com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
>> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
>> at
>> com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
>> at
>> com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
>> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
>> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11330136
>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11344658
Sent from the MyFaces - Users mailing list archive at Nabble.com.
Re: Problem in Tree2: nullpointer org.apache.myfaces.custom.tree2.UITreeData.encodeEnd
Posted by Andrew Robinson <an...@gmail.com>.
I don't think this is the problem, but I don't think you want the
a4j:region outside of the form.
As for the exception, that would occur if the tree data model is null.
Here is the line:
TreeState state = getDataModel().getTreeState();
On 6/27/07, Novin <no...@ml.com> wrote:
>
> Hi freinds,
>
> I have implemented tamhalk tree2, Initially it was working fine but now It
> is throwing nullpointer when treis to render the tree.
>
> Pls help me. here is the JSP page code for the tree to be displayed and
> stack trace of the exception.
>
> Does any one have any idea?
>
> Here is the faces config file.
> http://www.nabble.com/file/p11330136/faces-config.xml faces-config.xml
>
>
> Thanks and Regards,
> Novin Jaiswal
>
> <f:subview id="accounttreesubview">
> <a4j:region>
> <a4j:outputPanel ajaxRendered="true">
> <h:messages/>
> </a4j:outputPanel>
> <h:form id="frmAccountGrpupUpdate">
> <a4j:outputPanel id="accountTreePanel">
> <t:tree2 id="clientTree" value="#{accountTreeBean.treeData}"
> var="node" varNodeToggler="t" >
> <f:facet name="person" >
> <h:panelGroup id="grp1">
> <h:outputText value="#{node.description}" id="temp3"/>
> </h:panelGroup>
> </f:facet>
>
> <f:facet name="foo-folder">
> <h:panelGroup id="grp2">
> <h:outputText value="#{node.description}" id="temp7"/>
> </h:panelGroup>
> </f:facet>
>
> <f:facet name="document">
> <h:panelGroup id="grp3">
> <h:outputText value="#{node.description}"
> id="temp11"/>
> </h:panelGroup>
> </f:facet>
> </t:tree2>
> </a4j:outputPanel>
> </h:form>
> </a4j:region>
> </f:subview>
>
>
>
> SRVE0068E: Uncaught exception thrown in one of the service methods of the
> servlet: /pages/csin/tiles/account/accountTree.jsp. Exception thrown :
> java.lang.NullPointerException
> at
> org.apache.myfaces.custom.tree2.UITreeData.encodeEnd(UITreeData.java:120)
> at
> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:286)
> at
> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
> at
> org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:79)
> at
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:735)
> at
> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:282)
> at
> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
> at
> org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:284)
> at
> org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
> at
> org.ajax4jsf.framework.renderer.AjaxContainerRenderer.encodeChildren(AjaxContainerRenderer.java:100)
> at
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:735)
> at org.ajax4jsf.ajax.UIAjaxRegion.encodeChildren(UIAjaxRegion.java:117)
> at
> javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:611)
> at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:548)
> at com.ibm._jsp._accountTree._jspx_meth_a4j_region_0(_accountTree.java:448)
> at com.ibm._jsp._accountTree._jspx_meth_f_subview_0(_accountTree.java:468)
> at com.ibm._jsp._accountTree._jspService(_accountTree.java:93)
> at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
> at
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
> at
> com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)
> at
> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)
> at
> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:270)
> at
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:606)
> at
> org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:1034)
> at
> org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:484)
> at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
> at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
> at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
> at
> org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
> at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
> at
> com.ibm._jsp._commonLayout._jspx_meth_tiles_insert_3(_commonLayout.java:212)
> at com.ibm._jsp._commonLayout._jspx_meth_f_view_0(_commonLayout.java:264)
> at com.ibm._jsp._commonLayout._jspService(_commonLayout.java:131)
> at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
> at
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
> at
> com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:115)
> at
> com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:168)
> at
> com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:308)
> at
> com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:325)
> at
> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:236)
> at
> org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:222)
> at
> org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
> at
> org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
> at
> com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
> at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
> at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
> at
> org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
> at
> org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:277)
> at
> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
> at
> org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
> at
> com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
> at
> com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
> at
> com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
> at
> com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
> at
> com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
> at
> com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
> at
> com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
> at
> com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)
> at
> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
> at
> com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
> at
> com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
> at
> com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
> at
> com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
> at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
> at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
> at
> com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
> at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
> at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
>
>
> --
> View this message in context: http://www.nabble.com/Problem-in-Tree2%3A-nullpointer-org.apache.myfaces.custom.tree2.UITreeData.encodeEnd-tf3990148.html#a11330136
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>