incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arnaud MERGEY <amer...@sunopsis.com>
Subject NullPointerException in af:tree
Date Fri, 19 May 2006 14:39:26 GMT
Hi,
I try javadoc sample to use a tree and I have NullpointerException. My 
sample is very basic so I can understand why.

An idea,
thanks

My JSP page:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>

<f:view>
    <af:document>
        <f:facet name="metaContainer">
            <f:verbatim>
                <meta http-equiv="expires" content="0" />
                <meta http-equiv="pragma" content="no-cache" />
                <meta http-equiv="cache-control" content="no-cache, 
must-revalidate" />
            </f:verbatim>
        </f:facet>

        <af:tree var="node" value="#{treeModel.model}">
           

	<f:facet name="nodeStamp">
    		<af:outputText value="#{node.name}"/>
  	</f:facet>

        </af:tree>

    </af:document>
</f:view>

My backing bean
import java.util.ArrayList;
import java.util.List;

import oracle.adf.view.faces.model.ChildPropertyTreeModel;

import com.sunopsis.lwd.data.Person;

public class MyTreeModel {
    oracle.adf.view.faces.model.TreeModel model = null;

    public oracle.adf.view.faces.model.TreeModel getModel() {
        if (model == null) {
            Person john = new Person("John Smith");
            Person kim = new Person("Kim Smith");
            Person tom = new Person("Tom Smith");
            Person ira = new Person("Ira Wickrememsinghe");
            Person mallika = new Person("Mallika Wickremesinghe");

            john.getKids().add(kim);
            john.getKids().add(tom);
            ira.getKids().add(mallika);

            // create the list of root nodes:
            List people = new ArrayList();
            people.add(john);
            people.add(ira);

            //model = new ChildPropertyTreeModel(people, "kids");
            model=new ChildPropertyTreeModel();

        }
        return model;
    }
   
}

When I browse my page tomcat log this error
javax.faces.FacesException: java.lang.NullPointerException
    at 
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:439)
    at 
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
    at 
oracle.adfinternal.view.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:159)
    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 
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:279)
    at 
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:248)
    at 
oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:172)
    at 
oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:80)
    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.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    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.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
    at 
oracle.adfinternal.view.faces.ui.laf.base.xhtml.FormValueRenderer.addNeededValue(FormValueRenderer.java:114)
    at 
oracle.adfinternal.view.faces.ui.laf.base.xhtml.FormValueRenderer.addNeededValue(FormValueRenderer.java:91)
    at 
oracle.adfinternal.view.faces.ui.laf.base.desktop.TreeRenderer._renderContent(TreeRenderer.java:144)
    at 
oracle.adfinternal.view.faces.ui.laf.base.desktop.TreeRenderer.renderContent(TreeRenderer.java:67)
    at 
oracle.adfinternal.view.faces.ui.BaseRenderer.render(BaseRenderer.java:81)
    at 
oracle.adfinternal.view.faces.ui.laf.base.xhtml.XhtmlLafRenderer.render(XhtmlLafRenderer.java:66)
    at 
oracle.adfinternal.view.faces.uinode.UIXComponentUINode.renderInternal(UIXComponentUINode.java:177)
    at 
oracle.adfinternal.view.faces.uinode.UINodeRendererBase.encodeEnd(UINodeRendererBase.java:53)
    at 
oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)
    at 
oracle.adf.view.faces.component.UIXCollection.encodeEnd(UIXCollection.java:440)
    at 
oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeChild(CoreRenderer.java:236)
    at 
oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeAllChildren(CoreRenderer.java:255)
    at 
oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer.renderContent(PanelPartialRootRenderer.java:65)
    at 
oracle.adfinternal.view.faces.renderkit.core.xhtml.BodyRenderer.renderContent(BodyRenderer.java:117)
    at 
oracle.adfinternal.view.faces.renderkit.core.xhtml.PanelPartialRootRenderer.encodeAll(PanelPartialRootRenderer.java:147)
    at 
oracle.adfinternal.view.faces.renderkit.core.xhtml.BodyRenderer.encodeAll(BodyRenderer.java:60)
    at 
oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.delegateRenderer(CoreRenderer.java:271)
    at 
oracle.adfinternal.view.faces.renderkit.core.xhtml.DocumentRenderer.encodeAll(DocumentRenderer.java:60)
    at 
oracle.adfinternal.view.faces.renderkit.core.CoreRenderer.encodeEnd(CoreRenderer.java:159)
    at 
oracle.adf.view.faces.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:624)
    at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:495)
    at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363)
    at 
oracle.adf.view.faces.webapp.UIXComponentTag.doEndTag(UIXComponentTag.java:100)
    at org.apache.jsp.print_jsp._jspx_meth_af_document_0(print_jsp.java:168)
    at org.apache.jsp.print_jsp._jspx_meth_f_view_0(print_jsp.java:115)
    at org.apache.jsp.print_jsp._jspService(print_jsp.java:80)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
    at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
    at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at 
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
    ... 24 more


Mime
View raw message