Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4259

Cannot bind date to form proxy object when using JPA TemporalType.TIME

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 8.6.0, 8.6.1, 8.6.0.1
    • Databind, Databind 2
    • Java 11
      Spring Boot 2.1.3.RELEASE
      ZK Spring Boot starter 1.0.4
      ZK Spring core 4.0.0
      ZK 8.6.1
      ZK Theme pack 8.6.0.1 (iceblue)

    • None

      I'm not able to display a date in a form when it is mapped to a database Time object (using JPA annotation @Temporal(TemporalType.TIME) because it seems the form proxy object does not support it.

      Example :

      Schedule.java
      @Entity
      @Table(name = "schedule")
      public class Schedule {
      
          @Column
          @Temporal(TemporalType.DATE)
          private Date day;
      
          @Column
          @Temporal(TemporalType.TIME)
          private Date start;
      
          @Column
          @Temporal(TemporalType.TIME)
          private Date end;
      }
      

      So it is stored this way in the DB :

      edit-course.zul
      <div form="@id('course') @load(myVm.course) @save(myVm.course, before={'saveCourse'})">
          <forEach items="@load(course.schedules)">
              <hlayout>
                  <label value="@load(each.day)"/>
                  <label value="@load(each.start)"/>
                  <label value="@load(each.end)"/>
              </hlayout>
          </forEach>
      </div>
      

      As soon as I try to display start or end, I get:

      java.lang.NoClassDefFoundError: org/zkoss/bind/proxy/FormProxyObject
      

      Stack trace :

      java.lang.RuntimeException: by java.lang.NoClassDefFoundError: org/zkoss/bind/proxy/FormProxyObject
      	at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:515) ~[javassist-3.18.2-GA.jar:na]
      	at javassist.util.proxy.ProxyFactory.createClass2(ProxyFactory.java:492) ~[javassist-3.18.2-GA.jar:na]
      	at javassist.util.proxy.ProxyFactory.createClass1(ProxyFactory.java:428) ~[javassist-3.18.2-GA.jar:na]
      	at javassist.util.proxy.ProxyFactory.createClass(ProxyFactory.java:400) ~[javassist-3.18.2-GA.jar:na]
      	at org.zkoss.bind.proxy.ProxyHelper.createProxyIfAny(ProxyHelper.java:141) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.proxy.BeanProxyHandler.invoke(BeanProxyHandler.java:200) ~[zkbind-8.6.1.jar:8.6.1]
      	at ch.myorg.myproject.entities.Schedule_$$_jvsta8e_2.getStart(Schedule_$$_jvsta8e_2.java) ~[classes/:na]
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45009) ~[na:na]
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45012) ~[na:na]
      	at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
      	at org.zkoss.zel.BeanELResolver.getValue(BeanELResolver.java:100) ~[zel-8.6.1.jar:8.6.1]
      	at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:66) ~[zel-8.6.1.jar:8.6.1]
      	at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:66) ~[zel-8.6.1.jar:8.6.1]
      	at org.zkoss.xel.zel.XelELResolver.getValue(XelELResolver.java:99) ~[zcommon-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.xel.zel.BindELResolver.getValue(BindELResolver.java:123) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.zel.impl.parser.AstValue.getValue(AstValue.java:188) ~[zel-8.6.1.jar:8.6.1]
      	at org.zkoss.zel.impl.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) ~[zel-8.6.1.jar:8.6.1]
      	at org.zkoss.zkmax.bind.impl.ValueExpressionImplEx.getValue(ValueExpressionImplEx.java:52) ~[zkmax-8.6.1.jar:na]
      	at org.zkoss.xel.zel.ELXelExpression.evaluate(ELXelExpression.java:41) ~[zcommon-8.6.1.jar:8.6.1]
      	at org.zkoss.zkmax.bind.impl.BindEvaluatorXImplEx$LazyBindXelExpression.evaluate(BindEvaluatorXImplEx.java:124) ~[zkmax-8.6.1.jar:na]
      	at org.zkoss.bind.impl.BindEvaluatorXImpl.getValue(BindEvaluatorXImpl.java:46) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.impl.LoadPropertyBindingImpl.load(LoadPropertyBindingImpl.java:58) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.impl.PropertyBindingHandler.doLoadBinding(PropertyBindingHandler.java:140) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.impl.PropertyBindingHandler.doLoad(PropertyBindingHandler.java:341) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.impl.BinderImpl.loadComponentProperties0(BinderImpl.java:2499) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.impl.BinderImpl.loadComponent0(BinderImpl.java:2466) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.impl.BinderImpl.loadComponent(BinderImpl.java:2401) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle.reInitBinder0(BindUiLifeCycle.java:170) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle.reInitBinder(BindUiLifeCycle.java:109) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle.access$100(BindUiLifeCycle.java:55) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.bind.tracker.impl.BindUiLifeCycle$2.onEvent(BindUiLifeCycle.java:100) ~[zkbind-8.6.1.jar:8.6.1]
      	at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:3179) ~[zk-8.6.1.jar:8.6.1]
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3127) ~[zk-8.6.1.jar:8.6.1]
      	at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:3091) ~[zk-8.6.1.jar:8.6.1]
      	at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:138) ~[zk-8.6.1.jar:8.6.1]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1845) ~[zk-8.6.1.jar:8.6.1]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1617) ~[zk-8.6.1.jar:8.6.1]
      	at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1320) ~[zk-8.6.1.jar:8.6.1]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:611) ~[zk-8.6.1.jar:8.6.1]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:487) ~[zk-8.6.1.jar:8.6.1]
      	at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:495) ~[zk-8.6.1.jar:8.6.1]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:665) ~[javax.servlet-api-4.0.1.jar:4.0.1]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) ~[javax.servlet-api-4.0.1.jar:4.0.1]
      	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) ~[spring-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.5.RELEASE.jar:5.1.5.RELEASE]
      	at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler.jrHandle(ServletInitialHandler.java:40001) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at org.zeroturnaround.javarebel.integration.servlet.undertow.cbp.ServletInitialHandlerCBP.handleRequest(ServletInitialHandlerCBP.java:101) ~[ServletInitialHandlerCBP.class:na]
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104) ~[undertow-servlet-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:364) ~[undertow-core-2.0.17.Final.jar:2.0.17.Final]
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) ~[undertow-core-2.0.17.Final.jar:2.0.17.Final]
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
      	at java.base/java.lang.Thread.run(Thread.java:835) ~[na:na]
      Caused by: javassist.CannotCompileException: by java.lang.NoClassDefFoundError: org/zkoss/bind/proxy/FormProxyObject
      	at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:170) ~[javassist-3.18.2-GA.jar:na]
      	at javassist.util.proxy.ProxyFactory.createClass3(ProxyFactory.java:507) ~[javassist-3.18.2-GA.jar:na]
      	... 93 common frames omitted
      Caused by: java.lang.NoClassDefFoundError: org/zkoss/bind/proxy/FormProxyObject
      	at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[na:na]
      	at java.base/java.lang.ClassLoader._jr$defineClass(ClassLoader.java:1016) ~[na:na]
      	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:42016) ~[na:na]
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
      	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.__invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45009) ~[na:na]
      	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45012) ~[na:na]
      	at java.base/java.lang.reflect.Method.invoke(Method.java:567) ~[na:na]
      	at javassist.util.proxy.FactoryHelper.toClass2(FactoryHelper.java:182) ~[javassist-3.18.2-GA.jar:na]
      	at javassist.util.proxy.FactoryHelper.toClass(FactoryHelper.java:164) ~[javassist-3.18.2-GA.jar:na]
      	... 94 common frames omitted
      Caused by: java.lang.ClassNotFoundException: org.zkoss.bind.proxy.FormProxyObject
      	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) ~[na:na]
      	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[na:na]
      	... 105 common frames omitted
      

      I honestly don't have enough knowledge on how the form proxy object binding is working behind the scenes, so this may not be directly ZK related but I wanted to report this anyway

            Unassigned Unassigned
            YannUnil YannUnil
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: