diff --git a/CHANGES.md b/CHANGES.md index 57548a3eb..e255147dc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ Release Notes. * Support clickhouse-jdbc-plugin trace sql parameters * Support monitor jetty server work thread pool metric * Support Jersey REST framework +* Fix ClassCastException when SQLServer inserts data #### Documentation diff --git a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/PSSetterDefinitionOfJDBCInstrumentation.java b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/PSSetterDefinitionOfJDBCInstrumentation.java index 1d5ae8713..109dee19e 100644 --- a/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/PSSetterDefinitionOfJDBCInstrumentation.java +++ b/apm-sniffer/apm-sdk-plugin/jdbc-commons/src/main/java/org/apache/skywalking/apm/plugin/jdbc/PSSetterDefinitionOfJDBCInstrumentation.java @@ -26,6 +26,7 @@ import org.apache.skywalking.apm.plugin.jdbc.define.Constants; import static net.bytebuddy.matcher.ElementMatchers.named; import static net.bytebuddy.matcher.ElementMatchers.none; +import static net.bytebuddy.matcher.ElementMatchers.isPublic; import static org.apache.skywalking.apm.plugin.jdbc.define.Constants.PS_IGNORABLE_SETTERS; import static org.apache.skywalking.apm.plugin.jdbc.define.Constants.PS_SETTERS; @@ -43,7 +44,7 @@ public class PSSetterDefinitionOfJDBCInstrumentation implements InstanceMethodsI // remove TRACE_SQL_PARAMETERS judgement for dynamic config final Set setters = ignorable ? PS_IGNORABLE_SETTERS : PS_SETTERS; for (String setter : setters) { - matcher = matcher.or(named(setter)); + matcher = matcher.or(named(setter).and(isPublic())); } return matcher;