PickList: NullPointerException after validation failure with Mojarra
See original GitHub issueForum Post: https://forum.primefaces.org/viewtopic.php?f=3&t=58237
Stack Overflow: https://stackoverflow.com/questions/54826563/primefaces-picklist-with-omnifaces-validateall-leads-to-nullpointerexception
OmniFaces: https://github.com/omnifaces/omnifaces/issues/488
We null some NULL checks to guard against NPE’s.
The StackTrace is on the mentioned StackOverflow page. With PrimeFaces 7.0 it’s this:
Caused by:java.lang.NullPointerException
at org.primefaces.component.picklist.PickList.validateValue(PickList.java:140)
at javax.faces.component.UIInput.validate(UIInput.java:982)
at org.primefaces.component.picklist.PickList.validate(PickList.java:181)
at javax.faces.component.UIInput.executeValidate(UIInput.java:1248)
at javax.faces.component.UIInput.processValidators(UIInput.java:712)
at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:575)
at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1689)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
at javax.faces.component.UIForm.visitTree(UIForm.java:371)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:403)
at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:266)
at org.primefaces.context.PrimePartialViewContext.processPartial(PrimePartialViewContext.java:63)
at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:219)
at org.omnifaces.context.OmniPartialViewContext.processPartial(OmniPartialViewContext.java:124)
at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1193)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
And for the PickListRenderer the NPE is in line 127:
encodeList(context, pickList, clientId + "_target", PickList.TARGET_CLASS, model.getTarget(),
pickList.getFacet("targetCaption"), pickList.isShowTargetFilter(), false);
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (19 by maintainers)
Top Results From Across the Web
NullPointerException in PickListRenderer after validation failure
Caused by:java.lang.NullPointerException at org.primefaces.component.picklist.PickListRenderer.encodeMarkup(PickListRenderer.java:92) at org.
Read more >PrimeFaces PickList with OmniFaces validateAll leads to ...
When I run this code and leave at least one pickList empty, submitting the Done -button brings up a validation failure as excepted....
Read more >How to Fix and Avoid NullPointerException in Java - Rollbar
The NullPointerException occurs due to a situation in application code where an uninitialized object is attempted to be accessed or modified.
Read more >NullPointerException « Exception « JSF Q&A - Java2s.com
NullPointerException from RestoreViewPhase.notifyAfter stackoverflow.com. I'm getting the following error whenever I try to view JSF pages that contain forms.
Read more >Validator (Mojarra Implementation Javadoc (2.3)) - Javadoc.io
A Validator implementation is a class that can perform validation ... with Version 2 and later of the specification, it must not fail...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@mertsincan good fix for ELITE
Thats ok for me. I’m also not sure if it’s a Mojarra bug (could be a PF bug, too) but its likely as its working fine in MyFaces