org.primefaces.model.chart.BarChartModel.getTicks中的java.lang.NullPointerException

问题描述 投票:1回答:2

我正在使用Tomcat7,当我运行我的服务器时,我收到此错误。我没有得到这个错误它工作正常,但突然间出现了这个错误。网页显示此错误仅在我在页面中提交表单时出现。

java.lang.NullPointerException
    at org.primefaces.model.chart.BarChartModel.getTicks(BarChartModel.java:82)
    at org.primefaces.component.chart.renderer.BarRenderer.encodeOptions(BarRenderer.java:81)
    at org.primefaces.component.chart.renderer.BasePlotRenderer.render(BasePlotRenderer.java:30)
    at org.primefaces.component.chart.ChartRenderer.encodeScript(ChartRenderer.java:98)
    at org.primefaces.component.chart.ChartRenderer.encodeEnd(ChartRenderer.java:67)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:924)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
    at org.richfaces.renderkit.RendererBase.renderChildren(RendererBase.java:282)
    at org.richfaces.renderkit.html.TogglePanelItemRenderer.doEncodeChildren(TogglePanelItemRenderer.java:140)
    at org.richfaces.renderkit.html.TabRenderer.doEncodeChildren(TabRenderer.java:113)
    at org.richfaces.renderkit.RendererBase.encodeChildren(RendererBase.java:158)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
    at org.richfaces.renderkit.RendererBase.renderChildren(RendererBase.java:282)
    at org.richfaces.renderkit.html.TogglePanelRenderer.doEncodeChildren(TogglePanelRenderer.java:129)
    at org.richfaces.renderkit.RendererBase.encodeChildren(RendererBase.java:158)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894)
    at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304)
    at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:114)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:458)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:134)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
jsf primefaces charts nullpointerexception
2个回答
0
投票

在调试错误之后我发现我使用了一个BarChartModel变量但是意外删除了我设置它的行。


-1
投票

org.primefaces.model.chart.BarChartModel.getTicks中的java.lang.NullPointerException(BarChartModel.java:82

因为在你的BarChartModel: -

如果你使用Map并设置键/值如下:

map.set(key,value);

所以,key不能为null。

© www.soinside.com 2019 - 2024. All rights reserved.