Slair1 opened a new issue #3826: Unsafe Field Accessor with newer 
mysql-connector-java package
URL: https://github.com/apache/cloudstack/issues/3826
 
 
   <!--
   Verify first that your issue/request is not already reported on GitHub.
   Also test if the latest release and master branch are affected too.
   Always add information AFTER of these HTML comments, but no need to delete 
the comments.
   -->
   
   ##### ISSUE TYPE
   <!-- Pick one below and delete the rest -->
    * Bug Report
   
   ##### COMPONENT NAME
   <!--
   Categorize the issue, e.g. API, VR, VPN, UI, etc.
   -->
   ~~~
   mysql-connector-java
   ~~~
   
   ##### CLOUDSTACK VERSION
   <!--
   New line separated list of affected versions, commit ID for issues on master 
branch.
   -->
   
   ~~~
   4.11.3
   all
   ~~~
   
   ##### CONFIGURATION
   <!--
   Information about the configuration if relevant, e.g. basic network, 
advanced networking, etc.  N/A otherwise
   -->
   
   
   ##### OS / ENVIRONMENT
   <!--
   Information about the environment if relevant, N/A otherwise
   -->
   CentOS7
   
   ##### SUMMARY
   <!-- Explain the problem/feature briefly -->
   Looks like the new version (8.0.x) is stricter with conversions from Long to 
BigIntfor example.  Auto Increment fields in the database are of type BigInt, 
but in code we are using Long.  This generates the errors similar to the 
following at times:
   ~~~
   Can not set long field com.cloud.upgrade.dao.VersionVO.id to 
java.math.BigInteger
   ~~~
   ##### STEPS TO REPRODUCE
   <!--
   For bugs, show exactly how to reproduce the problem, using a minimal 
test-case. Use Screenshots if accurate.
   
   For new features, show how the feature would be used.
   -->
   Install any new version of mysql-connector-java
   
   <!-- Paste example playbooks or commands between quotes below -->
   ~~~
   We hit it while the database upgrade script was running 4.9.3.0 -> 4.10.0
   ~~~
   
   <!-- You can also paste gist.github.com links for larger files -->
   
   ##### EXPECTED RESULTS
   <!-- What did you expect to happen when running the steps above? -->
   
   ~~~
   Looks like older versions of mysql-connector-java did not care that we use 
Long in code by BigInt in the database columns
   ~~~
   
   ##### ACTUAL RESULTS
   <!-- What actually happened? -->
   We get errors such as this:
   <!-- Paste verbatim command output between quotes below -->
   ~~~
   Caused by: java.lang.IllegalArgumentException: Can not set long field 
com.cloud.upgrade.dao.VersionVO.id to java.math.BigInteger
           at 
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
           at 
sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
           at 
sun.reflect.UnsafeLongFieldAccessorImpl.set(UnsafeLongFieldAccessorImpl.java:102)
   ~~~
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to