Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
-
None
Description
exact error :
java.lang.ClassCastException: class java.util.LinkedHashMap$Entry cannot be cast to class java.util.HashMap$TreeNode (java.util.LinkedHashMap$Entry and java.util.HashMap$TreeNode are in module java.base of loader 'bootstrap') |
at java.base/java.util.HashMap$TreeNode.moveRootToFront(HashMap.java:1986) |
at java.base/java.util.HashMap$TreeNode.treeify(HashMap.java:2102) |
at java.base/java.util.HashMap.treeifyBin(HashMap.java:770) |
at java.base/java.util.HashMap.putVal(HashMap.java:642) |
at java.base/java.util.HashMap.put(HashMap.java:610) |
at org.mariadb.jdbc.util.ClientParser.parameterParts(ClientParser.java:160) |
at org.mariadb.jdbc.ClientPreparedStatement.<init>(ClientPreparedStatement.java:68) |
at org.mariadb.jdbc.Connection.prepareInternal(Connection.java:156) |
at org.mariadb.jdbc.Connection.prepareStatement(Connection.java:112) |
This is a concurency problem. a solution could be to use a ConcurrentHashMap, but after benchmarking the change, the solution would make it slower compare to not using cache at all, avoiding synchronized calls.
So solution is to remove entirely (like 2.7)