-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello, I've tried to use zk data binding with zk + spring web flow integration,
but I got some strange exception.
the zul file is like the following
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?> <?variable-resolver class="org.zkoss.spring.DelegatingVariableResolver"?> <zk:zk xmlns="http://www.zkoss.org/2005/zk/native" xmlns:zul="http://www.zkoss.org/2005/zul" xmlns:zk="http://www.zkoss.org/2005/zk"> <zul:window title="My First window" border="normal"> <zul:grid model="@{flowBean1.banks}"> <zul:columns> <zul:column label="ID"/> <zul:column label="Name"/> </zul:columns> <zul:rows> <zul:row self="@{each='bank'}"> <zul:textbox value="@{bank.bankPK.noBank}"/> <zul:textbox value="@{bank.nameBank}"/> </zul:row> </zul:rows> </zul:grid> <zul:button self="@{action(finish)}" label="Finish"/><br/> <zul:button self="@{action(restart)}" label="Restart"/> </zul:window> </zk:zk>
If I click Restart or Finish button, I always get the following exception
>>java.lang.IncompatibleClassChangeError: Found interface org.springframework.binding.mapping.MappingResult, but class was expected >> at org.zkoss.spring.webflow.execution.ZkFlowView$PropertyNotFoundError.test(ZkFlowView.java:262) >> at org.springframework.binding.mapping.impl.DefaultMappingResults.getResults(DefaultMappingResults.java:91) >> at org.zkoss.spring.webflow.execution.ZkFlowView.onlyPropertyNotFoundErrorsPresent(ZkFlowView.java:191) >> at org.zkoss.spring.webflow.execution.ZkFlowView.hasMappingErrors(ZkFlowView.java:187) >> at org.zkoss.spring.webflow.execution.ZkFlowView.processUserEvent(ZkFlowView.java:96) >> at org.springframework.webflow.engine.ViewState.resume(ViewState.java:187) >>...
However, if I remove the "grid" part, i.e., the zul file becomes:
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?> <?variable-resolver class="org.zkoss.spring.DelegatingVariableResolver"?> <zk:zk xmlns="http://www.zkoss.org/2005/zk/native" xmlns:zul="http://www.zkoss.org/2005/zul" xmlns:zk="http://www.zkoss.org/2005/zk"> <zul:window title="My First window" border="normal"> <!--zul:grid model="@{flowBean1.banks}"> <zul:columns> <zul:column label="ID"/> <zul:column label="Name"/> </zul:columns> <zul:rows> <zul:row self="@{each='bank'}"> <zul:textbox value="@{bank.bankPK.noBank}"/> <zul:textbox value="@{bank.nameBank}"/> </zul:row> </zul:rows> </zul:grid--> <zul:button self="@{action(finish)}" label="Finish"/><br/> <zul:button self="@{action(restart)}" label="Restart"/> </zul:window> </zk:zk>
Then the exception will not happen.
So, is there conflict between zk's tranditional data binding with zk + spring web flow integration?
Thanks!
After some further test,
it appears that the problem is caused by data binding to Collections with
"self" attribute
If remove the self attribute from <zul:row self="@{each='bank'}">,
the problem would disappear.
However, the self attribute is essential for collection binding,
I don't know if there exists any alternative for that?
Hello, hideokidd:
Thanks for the reply,
However, if I remove all configuration for zk's integration for spring web flow, all problem gone.
That is, if all configuration for org.zkoss.spring.web.servlet.view.ZkResourceViewResolver,
<zksp:flow-controller id="flowController" flow-executor="flowExecutor"/>, and
<zksp:flow-builder-services id="zkFlowBuilderServices" /> are removed, and stick to original spring web flow
configuration, all works as expected.
Of course, this way does have penalty, e.x.,
<zul:button self="@{action(runQuery)}" label="RunQuery"/>
can't be used, and this is very inconvenient.
By the way, I use glassfish instead of tomcat as the testing environment.
Hence, I believe the problem resides on the zk part rather than spring web flow part.
Hello, henrichen:
I setup a test case for tomcat, and I got exactly the same result.
The tomcat console still shows the following error message:
ๅด้็: >>java.lang.IncompatibleClassChangeError: Found interface org.springframework.binding.mapping.MappingResult, but class was expected >> at org.zkoss.spring.webflow.execution.ZkFlowView$PropertyNotFoundError.test(ZkFlowView.java:262) >> at org.springframework.binding.mapping.impl.DefaultMappingResults.getResults(DefaultMappingResults.java:91) >> at org.zkoss.spring.webflow.execution.ZkFlowView.onlyPropertyNotFoundErrorsPresent(ZkFlowView.java:191) >> at org.zkoss.spring.webflow.execution.ZkFlowView.hasMappingErrors(ZkFlowView.java:187) >> at org.zkoss.spring.webflow.execution.ZkFlowView.processUserEvent(ZkFlowView.java:96) >> at org.springframework.webflow.engine.ViewState.resume(ViewState.java:187) >>...
Hope this information helps.
Thank you!
Hi,
no one solution or work around for this bug?
I have the same problem.
Thank you for help,
Giovanni
Asked: 2009-01-30 14:54:19 +0800
Seen: 707 times
Last updated: Dec 01 '10