The application seemed to start fine but I am now plagued by empty strings being applied to view parameters. javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
parameter was already set to true in my web.xml.
Here's what I did to upgrade:
- Updated JSF artifacts: from javax.faces:javax.faces-api:2.2 and org.glassfish:javax.faces:2.2.15 to javax.faces:javax.faces-api:2.3 and org.glassfish:javax.faces:2.3.8.
- Updated namespace in faces-config.xml.
- Updated namespace in beans.xml to enable 2.0.
- Updated web.xml to servlet 4.0.
- Added javax.faces.ENABLE_CDI_RESOLVER_CHAIN and javax.faces.ENABLE_WEBSOCKET_ENDPOINT in web.xml.
- I even added a JSF 2.3 activator class even though it seemed as if it was redundant.
- OmniFaces updated from 2.6.9 to 3.2.
EDIT: Turns out this is related to Tomcat 8 (and 9) coerce behaviour, null strings are incorrectly set as empty strings
But as stated in the title I'm trying to migrate to JSF 2.3 on Tomcat 9 (9.0.12). The previous question and BalusC blog does not directly address this case. I should also state that the application was running on JDK11 without problems before this.
From the previous question I learned the using Oracles EL implementation could work but I'm getting:
java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 16 out of bounds for byte[9]
at java.base/java.lang.System.arraycopy(Native Method)
at com.sun.faces.util.ByteArrayGuardAESCTR.decrypt(ByteArrayGuardAESCTR.java:157)
at com.sun.faces.context.flash.ELFlash$PreviousNextFlashInfoManager.decode(ELFlash.java:1414)
at com.sun.faces.context.flash.ELFlash.getCurrentFlashManager(ELFlash.java:1237)
at com.sun.faces.context.flash.ELFlash.doPrePhaseActions(ELFlash.java:641)
at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:98)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:133)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670)