Liferay portlet won't be shown

286 views Asked by At

I already postet my Question in the Liferayforum, but without any Answer. https://www.liferay.com/de/community/forums/-/message_boards/message/55035046

I'm developing some Portlets with JSF Primefaces. But sometimes the Portlets wont be shown and there is only empty space. This happens just sometimes, without any reproducible reasons. Any Idea for this Issue?

Following Log:

14:41:41,416 ERROR [RuntimePageImpl-9][render_portlet_jsp:132] null
java.lang.NullPointerException
    at org.primefaces.component.chart.renderer.PieRenderer.encodeData(PieRenderer.java:34)
    at org.primefaces.component.chart.renderer.BasePlotRenderer.render(BasePlotRenderer.java:29)
    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:881)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:439)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:124)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:286)
    at com.liferay.faces.bridge.application.ViewHandlerCompatImpl.renderView(ViewHandlerCompatImpl.java:52)
    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:139)
    at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:227)
    at com.liferay.faces.bridge.BridgePhaseRenderImpl.execute(BridgePhaseRenderImpl.java:85)
    at com.liferay.faces.bridge.BridgeImpl.doFacesRequest(BridgeImpl.java:112)
    at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:255)
    at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:328)

For Those Reasons, are there any Error-Handling methods? If my Portlet will throw an exception, I just wan't to show a self-defined Error-Message or something.

Thanks

1

There are 1 answers

0
Gevatterjan On

Actually you have to find the Source of the NPE. If you have located where the NPE is originating you could wrap a try/catch around and use the

SessionErrors.add(actionRequest, "error-key");

method to add your error. For displaying it you would add this to your jsp:

<liferay-ui:error key="error-key" message="this-is-error-message-1" />