-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I'm using the MVC approach with GenericForwardComposer. Occasionally I get zul code and the controller out of sync (usually due to a misspelling or dropping a component no longer needed when re-factoring). All I get is a very unhelpful error message like below. I really like being able to do the layout in zul, but its value is significantly reduced in the overall development process if debugging support is poor. Any ideas appreciated? Thanks.
SEVERE: Servlet.service() for servlet zkLoader threw exception
java.lang.NullPointerException
at org.zkoss.zkplus.databind.Binding.registerLoadEvents(Binding.java:548)
at org.zkoss.zkplus.databind.DataBinder.registerLoadEvents(DataBinder.java:860)
at org.zkoss.zkplus.databind.DataBinder.init(DataBinder.java:664)
at org.zkoss.zkplus.databind.DataBinder.loadAll(DataBinder.java:551)
at org.zkoss.zkplus.databind.AnnotateDataBinderInit.doAfterCompose(AnnotateDataBinderInit.java:175)
at org.zkoss.zk.ui.impl.RealInits.doAfterCompose(Initiators.java:82)
at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:377)
at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:291)
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:238)
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:159)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:637)
It looks like a syntaxerror for the databinding load-event.
Something is wrong after load-when or load-after.
Post your zul-file, if you don't find the fault.
/Robert
Robert, This scenario is actually from a solved issue where I had a bad component reference in a load-after attribute:
<listbox id="personLb" model="@{controller.model.personData,load-after='searchTbWrongReferenceHere.onOK,indiSave.onClick'}" >
The way I found it was by commenting out sections of code until something worked, then putting stuff back in until it broke--kind of a binary-hunt-peck-search for the offending code. Is there a better solution from ZK than this? Do I drop ZUL and write richlets? Ease of layout process vs. code debug and maintenance? Thanks -ep
Hi eptx
could you post your sample code ?
@as1225: eptx has found the fault, the question is: is there a better do find errors is binding-code?
@eptx
>> Is there a better solution from ZK than this? Do I drop ZUL and write richlets?
1. ZUL-Code is checked by the ZK-Studio-Plugin - "only" the bindingcode" is unchecked.
2. I do not know a better way to search this error.
The unchecked bindingcodes is in fact a weak point, there are already feature requests i.e. this one.
However, one way to reduce bindingcode is to fire the load and save-events inside the controller, i.e.
Composer/Controller (with autowire and autoforward) { Listbox personLb; // autowired OR Component personLb; // Component public void onClick$indiSave() { // your code here binder.load(personLb); }
Note:
you can create scopes with every Component i.e.
<hbox id="output"> <label value="@{model.bean.value}"/> .... </hbox> Component output; // autowired by composer ... binder.load(output); binder.save(output); ...
/Robert
Hi Robert
OK, We will evaluate and improve zul editor for annotation checking in next ZK studio version
Hi Jimmy,
my personal number 1 feature request. :-)
Thx Robert
Asked: 2010-08-09 11:37:18 +0800
Seen: 683 times
Last updated: Aug 10 '10