-
Bug
-
Resolution: Fixed
-
Major
-
8.0.2
-
None
-
Security Level: Jimmy
-
None
-
None
problem description
Reproducible on first load when client has no cookies.
steps to reproduce
- clear all cookies with chrome developer tool
- load the 3338.zul
current result
NullPointerException - cookies can be null.
2016-09-23 09:37:45.388:WARN::/uipattern/3338.zul
java.lang.NullPointerException
at org.zkoss.bind.impl.BinderImpl.init(BinderImpl.java:354)
at org.zkoss.bind.AnnotateBinder.init(AnnotateBinder.java:58)
at org.zkoss.bind.BindComposer.doBeforeComposeChildren(BindComposer.java:164)
at org.zkoss.zk.ui.impl.UiEngineImpl.doBeforeComposeChildren(UiEngineImpl.java:997)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:937)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:895)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:777)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:841)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:797)
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:740)
at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:460)
at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:369)
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:211)
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:137)
expected result
no exception.
root cause
https://github.com/zkoss/zk/blob/master/zkbind/src/org/zkoss/bind/impl/BinderImpl.java
Line 354:
for (Cookie c : cookies) {
debug info
- reproduced it with jetty 6 (jetty 7 or 8 returns Cookie[0] so don't cause this error)
- according to javadoc of getCookies(), https://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpServletRequest.html#getCookies(), it could return null.
- Tomcat 6, 7, 8 also has this issue
- relates to
-
ZK-3247 @MatchMedia causes error on Jetty
- Closed