question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PickList: NullPointerException after validation failure with Mojarra

See original GitHub issue

Forum 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:closed
  • Created 4 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
tandraschkocommented, Apr 26, 2019

@mertsincan good fix for ELITE

0reactions
tandraschkocommented, May 7, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found