You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by ohaya <oh...@yahoo.com> on 2022/02/07 17:02:04 UTC

"java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.util.Date" error when upgrading MySQL and MySQL Java connector to 8.0.28

Hi,

We upgraded the MySQL on our 2.1.5 Syncope servers this weekend, and upgraded:

MySQL Community Server 8.0.25 ==> MySQL Community Server 8.0.28
MySQL Java Connector 8.0.16 ==> MySQL Java Connector 8.0.28  [when we had upgraded previously from MySQL 8.0.16 to MySQL 8.0.25, they forgot to upgrade the connector, so this time we upgraded the connector to 8.0.28 at the same time)

However, after that upgrade, when we go into Syncope Console and try to delete users from the Realms==>USERS, we are getting "UNKNOWN" and in the logs:

2022-02-07 14:34:21.638 ERROR org.apache.syncope.core.rest.cxf.RestServiceExceptionMapper - Exception thrown
java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.util.Date
        at org.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO.findLastChange(AbstractAnyDAO.java:144) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
        at org.apache.syncope.core.persistence.jpa.dao.JPAUserDAO.findLastChange(JPAUserDAO.java:116) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
        at sun.reflect.GeneratedMethodAccessor486.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_321]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_321]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) ~[spring-tx-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.apache.syncope.core.persistence.jpa.spring.DomainTransactionInterceptor.invoke(DomainTransactionInterceptor.java:60) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at com.sun.proxy.$Proxy69.findLastChange(Unknown Source) ~[?:?]
        at org.apache.syncope.core.rest.cxf.service.AbstractAnyService.findLastChange(AbstractAnyService.java:144) ~[syncope-core-rest-cxf-2.1.5.jar:2.1.5]
        at org.apache.syncope.core.rest.cxf.service.AbstractAnyService.delete(AbstractAnyService.java:206) ~[syncope-core-rest-cxf-2.1.5.jar:2.1.5]
        at sun.reflect.GeneratedMethodAccessor485.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_321]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_321]
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) ~[cxf-core-3.2.10.jar:3.2.10]
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[cxf-core-3.2.10.jar:3.2.10]
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) ~[cxf-rt-frontend-jaxrs-3.2.10.jar:3.2.10]
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) ~[cxf-rt-frontend-jaxrs-3.2.10.jar:3.2.10]


If we downgrade the MySQL java connector back to 8.0.16, then the delete via Syncope Console works.

Can anyone tell me why the Syncope Console doesn't work with the 8.0.28 MySQL Java connector?  FYI, we are having to update both the MySQL and the Java connector due to a CVE/security vulnerability.

Thanks,
Jim

Re: Is this a BUG in Syncope-MySQL code? was Re: "java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.util.Date" error when upgrading MySQL and MySQL Java connector to 8.0.28

Posted by ohaya <oh...@yahoo.com>.
 Hi,

I forgot to ask... do you have a guesstimate when 2.1.11 is going to be released?

Thanks,
Jim


     On Tuesday, February 8, 2022, 09:48:59 AM EST, ohaya <oh...@yahoo.com> wrote:  
 
  Hi Francesco,

THANKS for that (and it is nice to "see" you again, after a long time ;)! ). I will convey this info to our team.

Jim

P.S. And yes, we already tested the connector versions and found the same thing, only 8.0.22 and below worked, but 8.0.22 is not acceptable because of CVEs/security.


     On Tuesday, February 8, 2022, 12:25:29 AM EST, Francesco Chicchiriccò <il...@apache.org> wrote:  
 
  Hi, the issue you are reporting was fixed by commit [1] which will be released as part of Syncope 2.1.11. 
  Without such fix, the highest version of MySQL JDBC driver you can use is 8.0.22. 
  I would anyway strongly suggest to upgrade your deployment from 2.1.5 (which is 2+ years old and also missing a few security fixes [2]) to 2.1.10 as soon as possible, and also to upgrade to 2.1.11 once such release will be out. 
  Please have a look at 2.1.6 Release Notes [3] (and following) which also contains upgrade instructions from one version to the next one. 
  Regards.
  
  [1]https://github.com/apache/syncope/commit/448b053646af39c0b17e85f9c8745aa0d82d503d
 [2] https://syncope.apache.org/security
 [3]https://cwiki.apache.org/confluence/display/SYNCOPE/Fusion#Fusion-2.1.6(April29th,2020)
  
  On 07/02/22 18:16, ohaya wrote:
  
 
 Hi,
 
 I just found this:
 
 https://bugs.mysql.com/bug.php?id=102435
 
 which may explain the problem.
 
 If I am reading that thread correctly, it sounds like MySQL made a change in the behavior of their MySQL Java connector in connector V8.0.23 and going forward, which is causing that cast exception, and so whatever code is using that connector version(s), e.g., Syncope in our case, needs to be modified to accommodate the MySQL connector behavior change.
 
 As I mentioned earlier, we are on Syncope 2.1.5 now. Is there a later version of Syncope that resolves this problem?
 
 Please advise.
 
 Thanks,
 Jim
 
 
     On Monday, February 7, 2022, 12:02:04 PM EST, ohaya <oh...@yahoo.com> wrote:  
  
   Hi,
  
  We upgraded the MySQL on our 2.1.5 Syncope servers this weekend, and upgraded:
  
  MySQL Community Server 8.0.25 ==> MySQL Community Server 8.0.28
  MySQL Java Connector 8.0.16 ==> MySQL Java Connector 8.0.28  [when we had upgraded previously from MySQL 8.0.16 to MySQL 8.0.25, they forgot to upgrade the connector, so this time we upgraded the connector to 8.0.28 at the same time)
  
  However, after that upgrade, when we go into Syncope Console and try to delete users from the Realms==>USERS, we are getting "UNKNOWN" and in the logs:
  
  2022-02-07 14:34:21.638 ERROR org.apache.syncope.core.rest.cxf.RestServiceExceptionMapper - Exception thrown
  java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.util.Date
          atorg.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO.findLastChange(AbstractAnyDAO.java:144) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
          atorg.apache.syncope.core.persistence.jpa.dao.JPAUserDAO.findLastChange(JPAUserDAO.java:116) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
          at sun.reflect.GeneratedMethodAccessor486.invoke(Unknown Source) ~[?:?]
          atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_321]
          at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_321]
          atorg.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) ~[spring-tx-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.apache.syncope.core.persistence.jpa.spring.DomainTransactionInterceptor.invoke(DomainTransactionInterceptor.java:60) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
          atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          at com.sun.proxy.$Proxy69.findLastChange(Unknown Source) ~[?:?]
          atorg.apache.syncope.core.rest.cxf.service.AbstractAnyService.findLastChange(AbstractAnyService.java:144) ~[syncope-core-rest-cxf-2.1.5.jar:2.1.5]
          atorg.apache.syncope.core.rest.cxf.service.AbstractAnyService.delete(AbstractAnyService.java:206) ~[syncope-core-rest-cxf-2.1.5.jar:2.1.5]
          at sun.reflect.GeneratedMethodAccessor485.invoke(Unknown Source) ~[?:?]
          atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_321]
          at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_321]
          atorg.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) ~[cxf-core-3.2.10.jar:3.2.10]
          atorg.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[cxf-core-3.2.10.jar:3.2.10]
          at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) ~[cxf-rt-frontend-jaxrs-3.2.10.jar:3.2.10]
          at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) ~[cxf-rt-frontend-jaxrs-3.2.10.jar:3.2.10]
  
  
  If we downgrade the MySQL java connector back to 8.0.16, then the delete via Syncope Console works.
  
  Can anyone tell me why the Syncope Console doesn't work with the 8.0.28 MySQL Java connector?  FYI, we are having to update both the MySQL and the Java connector due to a CVE/security vulnerability.
  
  Thanks,
  Jim
     

 
 -- Francesco ChicchiriccòTirasa - Open Source Excellencehttp://www.tirasa.net/Member at The Apache Software FoundationSyncope, Cocoon, Olingo, CXF, OpenJPA, PonyMailhttp://home.apache.org/~ilgrosso/     

Re: Is this a BUG in Syncope-MySQL code? was Re: "java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.util.Date" error when upgrading MySQL and MySQL Java connector to 8.0.28

Posted by ohaya <oh...@yahoo.com>.
 Hi Francesco,

THANKS for that (and it is nice to "see" you again, after a long time ;)! ). I will convey this info to our team.

Jim

P.S. And yes, we already tested the connector versions and found the same thing, only 8.0.22 and below worked, but 8.0.22 is not acceptable because of CVEs/security.


     On Tuesday, February 8, 2022, 12:25:29 AM EST, Francesco Chicchiriccò <il...@apache.org> wrote:  
 
  Hi, the issue you are reporting was fixed by commit [1] which will be released as part of Syncope 2.1.11. 
  Without such fix, the highest version of MySQL JDBC driver you can use is 8.0.22. 
  I would anyway strongly suggest to upgrade your deployment from 2.1.5 (which is 2+ years old and also missing a few security fixes [2]) to 2.1.10 as soon as possible, and also to upgrade to 2.1.11 once such release will be out. 
  Please have a look at 2.1.6 Release Notes [3] (and following) which also contains upgrade instructions from one version to the next one. 
  Regards.
  
  [1]https://github.com/apache/syncope/commit/448b053646af39c0b17e85f9c8745aa0d82d503d
 [2] https://syncope.apache.org/security
 [3]https://cwiki.apache.org/confluence/display/SYNCOPE/Fusion#Fusion-2.1.6(April29th,2020)
  
  On 07/02/22 18:16, ohaya wrote:
  
 
 Hi,
 
 I just found this:
 
 https://bugs.mysql.com/bug.php?id=102435
 
 which may explain the problem.
 
 If I am reading that thread correctly, it sounds like MySQL made a change in the behavior of their MySQL Java connector in connector V8.0.23 and going forward, which is causing that cast exception, and so whatever code is using that connector version(s), e.g., Syncope in our case, needs to be modified to accommodate the MySQL connector behavior change.
 
 As I mentioned earlier, we are on Syncope 2.1.5 now. Is there a later version of Syncope that resolves this problem?
 
 Please advise.
 
 Thanks,
 Jim
 
 
     On Monday, February 7, 2022, 12:02:04 PM EST, ohaya <oh...@yahoo.com> wrote:  
  
   Hi,
  
  We upgraded the MySQL on our 2.1.5 Syncope servers this weekend, and upgraded:
  
  MySQL Community Server 8.0.25 ==> MySQL Community Server 8.0.28
  MySQL Java Connector 8.0.16 ==> MySQL Java Connector 8.0.28  [when we had upgraded previously from MySQL 8.0.16 to MySQL 8.0.25, they forgot to upgrade the connector, so this time we upgraded the connector to 8.0.28 at the same time)
  
  However, after that upgrade, when we go into Syncope Console and try to delete users from the Realms==>USERS, we are getting "UNKNOWN" and in the logs:
  
  2022-02-07 14:34:21.638 ERROR org.apache.syncope.core.rest.cxf.RestServiceExceptionMapper - Exception thrown
  java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.util.Date
          atorg.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO.findLastChange(AbstractAnyDAO.java:144) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
          atorg.apache.syncope.core.persistence.jpa.dao.JPAUserDAO.findLastChange(JPAUserDAO.java:116) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
          at sun.reflect.GeneratedMethodAccessor486.invoke(Unknown Source) ~[?:?]
          atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_321]
          at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_321]
          atorg.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) ~[spring-tx-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.apache.syncope.core.persistence.jpa.spring.DomainTransactionInterceptor.invoke(DomainTransactionInterceptor.java:60) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
          atorg.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          atorg.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
          at com.sun.proxy.$Proxy69.findLastChange(Unknown Source) ~[?:?]
          atorg.apache.syncope.core.rest.cxf.service.AbstractAnyService.findLastChange(AbstractAnyService.java:144) ~[syncope-core-rest-cxf-2.1.5.jar:2.1.5]
          atorg.apache.syncope.core.rest.cxf.service.AbstractAnyService.delete(AbstractAnyService.java:206) ~[syncope-core-rest-cxf-2.1.5.jar:2.1.5]
          at sun.reflect.GeneratedMethodAccessor485.invoke(Unknown Source) ~[?:?]
          atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_321]
          at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_321]
          atorg.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) ~[cxf-core-3.2.10.jar:3.2.10]
          atorg.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[cxf-core-3.2.10.jar:3.2.10]
          at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) ~[cxf-rt-frontend-jaxrs-3.2.10.jar:3.2.10]
          at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) ~[cxf-rt-frontend-jaxrs-3.2.10.jar:3.2.10]
  
  
  If we downgrade the MySQL java connector back to 8.0.16, then the delete via Syncope Console works.
  
  Can anyone tell me why the Syncope Console doesn't work with the 8.0.28 MySQL Java connector?  FYI, we are having to update both the MySQL and the Java connector due to a CVE/security vulnerability.
  
  Thanks,
  Jim
     

 
 -- Francesco ChicchiriccòTirasa - Open Source Excellencehttp://www.tirasa.net/Member at The Apache Software FoundationSyncope, Cocoon, Olingo, CXF, OpenJPA, PonyMailhttp://home.apache.org/~ilgrosso/   

Re: Is this a BUG in Syncope-MySQL code? was Re: "java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.util.Date" error when upgrading MySQL and MySQL Java connector to 8.0.28

Posted by Francesco Chicchiriccò <il...@apache.org>.
Hi,
the issue you are reporting was fixed by commit [1] which will be released as part of Syncope 2.1.11.

Without such fix, the highest version of MySQL JDBC driver you can use is 8.0.22.

I would anyway strongly suggest to upgrade your deployment from 2.1.5 (which is 2+ years old and also missing a few security fixes [2]) to 2.1.10 as soon as possible, and also to upgrade to 2.1.11 once such release will be out.

Please have a look at 2.1.6 Release Notes [3] (and following) which also contains upgrade instructions from one version to the next one.

Regards.

[1] https://github.com/apache/syncope/commit/448b053646af39c0b17e85f9c8745aa0d82d503d
[2] https://syncope.apache.org/security
[3] https://cwiki.apache.org/confluence/display/SYNCOPE/Fusion#Fusion-2.1.6(April29th,2020)

On 07/02/22 18:16, ohaya wrote:
> Hi,
>
> I just found this:
>
> https://bugs.mysql.com/bug.php?id=102435
>
> which may explain the problem.
>
> If I am reading that thread correctly, it sounds like MySQL made a change in the behavior of their MySQL Java connector in connector V8.0.23 and going forward, which is causing that cast exception, and so whatever code is using that connector version(s), e.g., Syncope in our case, needs to be modified to accommodate the MySQL connector behavior change.
>
> As I mentioned earlier, we are on Syncope 2.1.5 now. Is there a later version of Syncope that resolves this problem?
>
> Please advise.
>
> Thanks,
> Jim
>
>
> On Monday, February 7, 2022, 12:02:04 PM EST, ohaya <oh...@yahoo.com> wrote:
>
>
> Hi,
>
> We upgraded the MySQL on our 2.1.5 Syncope servers this weekend, and upgraded:
>
> MySQL Community Server 8.0.25 ==> MySQL Community Server 8.0.28
> MySQL Java Connector 8.0.16 ==> MySQL Java Connector 8.0.28  [when we had upgraded previously from MySQL 8.0.16 to MySQL 8.0.25, they forgot to upgrade the connector, so this time we upgraded the connector to 8.0.28 at the same time)
>
> However, after that upgrade, when we go into Syncope Console and try to delete users from the Realms==>USERS, we are getting "UNKNOWN" and in the logs:
>
> 2022-02-07 14:34:21.638 ERROR org.apache.syncope.core.rest.cxf.RestServiceExceptionMapper - Exception thrown
> java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.util.Date
>         at org.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO.findLastChange(AbstractAnyDAO.java:144) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
>         at org.apache.syncope.core.persistence.jpa.dao.JPAUserDAO.findLastChange(JPAUserDAO.java:116) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
>         at sun.reflect.GeneratedMethodAccessor486.invoke(Unknown Source) ~[?:?]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_321]
>         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_321]
>         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
>         at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) ~[spring-tx-5.1.9.RELEASE.jar:5.1.9.RELEASE]
>         at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.1.9.RELEASE.jar:5.1.9.RELEASE]
>         at org.apache.syncope.core.persistence.jpa.spring.DomainTransactionInterceptor.invoke(DomainTransactionInterceptor.java:60) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
>         at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
>         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
>         at com.sun.proxy.$Proxy69.findLastChange(Unknown Source) ~[?:?]
>         at org.apache.syncope.core.rest.cxf.service.AbstractAnyService.findLastChange(AbstractAnyService.java:144) ~[syncope-core-rest-cxf-2.1.5.jar:2.1.5]
>         at org.apache.syncope.core.rest.cxf.service.AbstractAnyService.delete(AbstractAnyService.java:206) ~[syncope-core-rest-cxf-2.1.5.jar:2.1.5]
>         at sun.reflect.GeneratedMethodAccessor485.invoke(Unknown Source) ~[?:?]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_321]
>         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_321]
>         at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) ~[cxf-core-3.2.10.jar:3.2.10]
>         at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[cxf-core-3.2.10.jar:3.2.10]
>         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) ~[cxf-rt-frontend-jaxrs-3.2.10.jar:3.2.10]
>         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) ~[cxf-rt-frontend-jaxrs-3.2.10.jar:3.2.10]
>
>
> If we downgrade the MySQL java connector back to 8.0.16, then the delete via Syncope Console works.
>
> Can anyone tell me why the Syncope Console doesn't work with the 8.0.28 MySQL Java connector?  FYI, we are having to update both the MySQL and the Java connector due to a CVE/security vulnerability.
>
> Thanks,
> Jim


-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/

Is this a BUG in Syncope-MySQL code? was Re: "java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.util.Date" error when upgrading MySQL and MySQL Java connector to 8.0.28

Posted by ohaya <oh...@yahoo.com>.
 Hi,

I just found this:

https://bugs.mysql.com/bug.php?id=102435

which may explain the problem.

If I am reading that thread correctly, it sounds like MySQL made a change in the behavior of their MySQL Java connector in connector V8.0.23 and going forward, which is causing that cast exception, and so whatever code is using that connector version(s), e.g., Syncope in our case, needs to be modified to accommodate the MySQL connector behavior change.

As I mentioned earlier, we are on Syncope 2.1.5 now. Is there a later version of Syncope that resolves this problem?

Please advise.

Thanks,
Jim


     On Monday, February 7, 2022, 12:02:04 PM EST, ohaya <oh...@yahoo.com> wrote:  
 
 Hi,

We upgraded the MySQL on our 2.1.5 Syncope servers this weekend, and upgraded:

MySQL Community Server 8.0.25 ==> MySQL Community Server 8.0.28
MySQL Java Connector 8.0.16 ==> MySQL Java Connector 8.0.28  [when we had upgraded previously from MySQL 8.0.16 to MySQL 8.0.25, they forgot to upgrade the connector, so this time we upgraded the connector to 8.0.28 at the same time)

However, after that upgrade, when we go into Syncope Console and try to delete users from the Realms==>USERS, we are getting "UNKNOWN" and in the logs:

2022-02-07 14:34:21.638 ERROR org.apache.syncope.core.rest.cxf.RestServiceExceptionMapper - Exception thrown
java.lang.ClassCastException: java.time.LocalDateTime cannot be cast to java.util.Date
        at org.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO.findLastChange(AbstractAnyDAO.java:144) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
        at org.apache.syncope.core.persistence.jpa.dao.JPAUserDAO.findLastChange(JPAUserDAO.java:116) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
        at sun.reflect.GeneratedMethodAccessor486.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_321]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_321]
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295) ~[spring-tx-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.apache.syncope.core.persistence.jpa.spring.DomainTransactionInterceptor.invoke(DomainTransactionInterceptor.java:60) ~[syncope-core-persistence-jpa-2.1.5.jar:2.1.5]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.1.9.RELEASE.jar:5.1.9.RELEASE]
        at com.sun.proxy.$Proxy69.findLastChange(Unknown Source) ~[?:?]
        at org.apache.syncope.core.rest.cxf.service.AbstractAnyService.findLastChange(AbstractAnyService.java:144) ~[syncope-core-rest-cxf-2.1.5.jar:2.1.5]
        at org.apache.syncope.core.rest.cxf.service.AbstractAnyService.delete(AbstractAnyService.java:206) ~[syncope-core-rest-cxf-2.1.5.jar:2.1.5]
        at sun.reflect.GeneratedMethodAccessor485.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_321]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_321]
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) ~[cxf-core-3.2.10.jar:3.2.10]
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[cxf-core-3.2.10.jar:3.2.10]
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) ~[cxf-rt-frontend-jaxrs-3.2.10.jar:3.2.10]
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) ~[cxf-rt-frontend-jaxrs-3.2.10.jar:3.2.10]


If we downgrade the MySQL java connector back to 8.0.16, then the delete via Syncope Console works.

Can anyone tell me why the Syncope Console doesn't work with the 8.0.28 MySQL Java connector?  FYI, we are having to update both the MySQL and the Java connector due to a CVE/security vulnerability.

Thanks,
Jim