Which version of ZKGrails you're using? On what operating system?
ZKGrails 2.2.0, ZK 6.5.2 EE, OSX version 10.9
Which version of Grails you're using?
2.2.1
What steps will reproduce the problem?
1. Try to use the groovy metaClass within a zul file (see example below)
2.
3.
What is the expected output? What do you see instead?
Browser should show "new field", and instead of that I am getting
Error 500: Internal Server Error
URI
/billing-ui/customer/test.zul
Class
org.zkoss.zel.PropertyNotFoundException
Message
Property 'newField' not found on type java.lang.String
Please provide any additional information below. Attaching a test case to
reproduce it is preferable.
I am using ZKGrails 2.2.0 and ZK 6.5.2 EE.
For example, I am trying to do something like this:
<div apply="grailsBindComposer"
viewModel="@id('vm') @init('testViewModel')">
<label value="@load(vm.str.newField)"/>
</div>
class TestViewModel {
String str = "test"
@Init
void init() {
String.metaClass.newField = "new field"
println "str.newField = $str.newField"
}
}
The above prints in standard output "str.newField = new field" and then throws
the below exception, indicating that although the metaClass works fine within
the view model, it throws the exception when used within the zul file.
14:44:15.210 [http-bio-9999-exec-1] ERROR
org.apache.catalina.core.StandardWrapperValve:269 - Servlet.service() for
servlet [zkLoader] in context with path [/billing-ui] threw exception
org.zkoss.zk.ui.UiException: Property 'newField' not found on type
java.lang.String at [null, line:3]
at org.zkoss.bind.impl.MiscUtil.mergeExceptionInfo(MiscUtil.java:175) ~[zkbind.jar:6.5.2]
at org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:45) ~[zkbind.jar:6.5.2]
at org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:62) ~[zkbind.jar:6.5.2]
at org.zkoss.bind.impl.PropertyBindingHandler.doLoadBinding(PropertyBindingHandler.java:171) ~[zkbind.jar:6.5.2]
at org.zkoss.bind.impl.PropertyBindingHandler.doLoad(PropertyBindingHandler.java:372) ~[zkbind.jar:6.5.2]
at org.zkoss.bind.impl.BinderImpl.loadComponentProperties0(BinderImpl.java:2069) ~[zkbind.jar:6.5.2]
at org.zkoss.bind.impl.BinderImpl.loadComponent0(BinderImpl.java:2046) ~[zkbind.jar:6.5.2]
at org.zkoss.bind.impl.BinderImpl.loadComponent0(BinderImpl.java:2049) ~[zkbind.jar:6.5.2]
at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:2037) ~[zkbind.jar:6.5.2]
at org.zkoss.zk.grails.composer.GrailsBindComposer$BinderKeeper$Loader.load(GrailsBindComposer.java:502) ~[plugin-classes/:na]
at org.zkoss.zk.grails.composer.GrailsBindComposer$BinderKeeper.loadComponentForAllBinders(GrailsBindComposer.java:484) ~[plugin-classes/:na]
at org.zkoss.zk.grails.composer.GrailsBindComposer.doAfterCompose(GrailsBindComposer.java:185) ~[plugin-classes/:na]
at org.zkoss.zk.ui.impl.UiEngineImpl.doAfterCompose(UiEngineImpl.java:537) ~[zk.jar:6.5.2]
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild0(UiEngineImpl.java:832) ~[zk.jar:6.5.2]
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreateChild(UiEngineImpl.java:778) ~[zk.jar:6.5.2]
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate0(UiEngineImpl.java:687) ~[zk.jar:6.5.2]
at org.zkoss.zk.ui.impl.UiEngineImpl.execCreate(UiEngineImpl.java:651) ~[zk.jar:6.5.2]
at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage0(UiEngineImpl.java:401) ~[zk.jar:6.5.2]
at org.zkoss.zk.ui.impl.UiEngineImpl.execNewPage(UiEngineImpl.java:316) ~[zk.jar:6.5.2]
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:215) ~[zk.jar:6.5.2]
at org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:136) ~[zk.jar:6.5.2]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.zkoss.zk.grails.web.ZULUrlMappingsFilter.processFilterChain(ZULUrlMappingsFilter.java:395) ~[plugin-classes/:na]
at org.zkoss.zk.grails.web.ZULUrlMappingsFilter.doFilterInternal(ZULUrlMappingsFilter.java:264) ~[plugin-classes/:na]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.zkoss.zk.grails.web.ZKGrailsPageFilter.obtainContent(ZKGrailsPageFilter.java:319) ~[plugin-classes/:na]
at org.zkoss.zk.grails.web.ZKGrailsPageFilter.doFilter(ZKGrailsPageFilter.java:195) ~[plugin-classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at javax.servlet.FilterChain$doFilter.call(Unknown Source) ~[na:na]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) ~[groovy-all-2.0.7.jar:2.0.7]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) ~[groovy-all-2.0.7.jar:2.0.7]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) ~[groovy-all-2.0.7.jar:2.0.7]
at org.grails.plugin.resource.DevModeSanityFilter.doFilter(DevModeSanityFilter.groovy:44) ~[plugin-classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:369) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.codehaus.groovy.grails.plugins.springsecurity.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:40) ~[plugin-classes/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at billing.ui.security.BillingAuthenticationFilter.doFilter(BillingAuthenticationFilter.groovy) ~[classes/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.codehaus.groovy.grails.plugins.springsecurity.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:79) ~[plugin-classes/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168) ~[spring-security-web-3.0.7.RELEASE.jar:3.0.7.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69) ~[grails-web-2.2.1.jar:2.2.1]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:66) ~[grails-web-2.2.1.jar:2.2.1]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.zkoss.zk.grails.web.ZKGrailsOpenSessionInViewFilter.doFilterInternal(ZKGrailsOpenSessionInViewFilter.java:37) ~[plugin-classes/:na]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) ~[spring-web-3.1.4.RELEASE.jar:3.1.4.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) [tomcat-embed-core-7.0.30.jar:7.0.30]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [na:1.6.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [na:1.6.0_45]
at java.lang.Thread.run(Thread.java:680) [na:1.6.0_45]
Caused by: org.zkoss.zel.PropertyNotFoundException: Property 'newField' not
found on type java.lang.String
at org.zkoss.zel.BeanELResolver$BeanProperties.get(BeanELResolver.java:304) ~[zel.jar:6.5.2]
at org.zkoss.zel.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:255) ~[zel.jar:6.5.2]
at org.zkoss.zel.BeanELResolver.property(BeanELResolver.java:429) ~[zel.jar:6.5.2]
at org.zkoss.zel.BeanELResolver.getValue(BeanELResolver.java:88) ~[zel.jar:6.5.2]
at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67) ~[zel.jar:6.5.2]
at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67) ~[zel.jar:6.5.2]
at org.zkoss.xel.zel.XelELResolver.getValue(XelELResolver.java:72) ~[zcommon.jar:6.5.2]
at org.zkoss.bind.xel.zel.BindELResolver.getValue(BindELResolver.java:69) ~[zkbind.jar:6.5.2]
at org.zkoss.zel.impl.parser.AstValue.getValue(AstValue.java:177) ~[zel.jar:6.5.2]
at org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) ~[zel.jar:6.5.2]
at org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:40) ~[zcommon.jar:6.5.2]
at org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:43) ~[zkbind.jar:6.5.2]
... 92 common frames omitted
Original issue reported on code.google.com by george.f...@gmail.com on 12 Dec 2013 at 3:02
Original issue reported on code.google.com by
george.f...@gmail.com
on 12 Dec 2013 at 3:02