views:

186

answers:

0

I am using myfaces extension in JSF to use extended components. The component x:inputFileUpload is working for me. I tried to replace an h:dataTable component with myfaces x:dataList component to get rid of the table elements in rendered HTML. It seems as if this component is not able to see any properties from the backing bean. Here is a snippet of the code: JSP:

<x:dataList var="state" value="#{onePage.states}">
<x:outputText value="#{state[0]}"/>
<x:outputText value="#{state[1]}"/>
</x:dataList>

Here is the code in my backing bean: private String[][] states = { { "Alabama", "AL" }, { "Alaska", "AK" }, { "Arizona", "AZ" }, { "Arkansas", "AR" }, { "California", "CA" }};

public String[][] getStates() {
 return states;
}

The page throws a null pointer exception when loaded:

[#|2008-10-30T17:02:39.930+0530|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=20;_ThreadName=httpSSLWorkerThread-9081-4;_RequestID=12f9fa4b-b69a-4800-b4a9-87be7738fedc;|StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception java.lang.NullPointerException at org.apache.myfaces.component.html.ext.HtmlDataTableHack.setDataModel(HtmlDataTableHack.java:341) at javax.faces.component.UIData.setValueBinding(UIData.java:634) at org.apache.myfaces.component.html.ext.HtmlDataTableHack.setValueBinding(HtmlDataTableHack.java:313) at org.apache.myfaces.taglib.UIComponentTagUtils.setValueProperty(UIComponentTagUtils.java:127) at org.apache.myfaces.taglib.UIComponentBodyTagBase.setValueProperty(UIComponentBodyTagBase.java:166) at org.apache.myfaces.taglib.UIComponentBodyTagBase.setProperties(UIComponentBodyTagBase.java:108) at org.apache.myfaces.taglib.html.HtmlComponentBodyTagBase.setProperties(HtmlComponentBodyTagBase.java:72) at org.apache.myfaces.custom.datalist.HtmlDataListTag.setProperties(HtmlDataListTag.java:79) at javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:209) at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:476) at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:660) at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1126) at org.apache.jsp.editor.downloadphotos_jsp._jspx_meth_x_dataList_0(downloadphotos_jsp.java:861) at org.apache.jsp.editor.downloadphotos_jsp._jspx_meth_h_form_0(downloadphotos_jsp.java:384) at org.apache.jsp.editor.downloadphotos_jsp._jspx_meth_f_view_0(downloadphotos_jsp.java:279) at org.apache.jsp.editor.downloadphotos_jsp._jspService(downloadphotos_jsp.java:225) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93) at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364) at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:855) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:542) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:474) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:366) at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:408) at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:442) at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245) at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at edu.mit.alum.security.servlet.PostLoginFilter.doFilter(PostLoginFilter.java:70) at edu.mit.alum.foundation.AbstractFilter.doFilter(AbstractFilter.java:67) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at edu.mit.alum.security.servlet.AbstractAuthorizationFilter.doFilter(AbstractAuthorizationFilter.java:65) at edu.mit.alum.foundation.AbstractFilter.doFilter(AbstractFilter.java:67) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at edu.mit.alum.security.servlet.AbstractAuthorizationFilter.doFilter(AbstractAuthorizationFilter.java:65) at edu.mit.alum.foundation.AbstractFilter.doFilter(AbstractFilter.java:67) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at edu.mit.alum.servlet.UserFilter.doFilter(UserFilter.java:101) at edu.mit.alum.foundation.AbstractFilter.doFilter(AbstractFilter.java:67) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at edu.mit.alum.ui.servlet.SiteTreeFilter.doFilter(SiteTreeFilter.java:73) at edu.mit.alum.foundation.AbstractFilter.doFilter(AbstractFilter.java:67) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568) at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813) at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341) at com.sun.enterprise.web.connector.grizzly.ssl.SSLReadTask.process(SSLReadTask.java:440) at com.sun.enterprise.web.connector.grizzly.ssl.SSLReadTask.doTask(SSLReadTask.java:228) at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265) at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)

Am I missing some configuration or is there some problem in the code here?