Primitive types cause a NullPointerException in CdiUtils.createConverter
When using a primitive type, I get the following exception in 2.3.4:
Caused by: java.lang.NullPointerException
at com.sun.faces.cdi.CdiUtils.createConverter(CdiUtils.java:125) ~[javax.faces-2.3.4.jar:2.3.4]
It is working using 2.3.3
IMHO, that looks like a bug that can easily solved. Converting the for look like so should do the trick:
for (
Class<?> forClassOrSuperclass = forClass;
managedConverter == null && forClassOrSuperclass != Object.class
&& forClassOrSuperclass != null; // <-- add this line
forClassOrSuperclass = forClassOrSuperclass.getSuperclass()
) {
Mind you: the type system of Java allows you to use primitive types the same way it allows you to use ordinary objects, pretending primitive type have a type. Of course, that's only a thin layer. It shows when accessing the super class. Usually, it's java.lang.Object, but in the case of primitive types, it's null.
Hope that helps! Stephan
This also effects 2.3.5.SP1 shipped with WildFly 13.0.0.Final.
This problem bothers me too
I am seeing this issue in Wildfly 14 also. Where and how can I apply the fix mentioned above.
Created issue at ee4j https://github.com/eclipse-ee4j/mojarra/issues/4500