Closed mouseDH closed 4 years ago
cc @safris could be related to #60
@mouseDH and @malafeev, this is fixed in the current development SNAPSHOT (v0.2.6-SNAPSHOT). It was fixed in this commit in this file. A test for this situation was added here.
I believe it would be best to push v0.2.7, before more people stumble on this issue in 0.2.6.
I was confused by
<dependency>
<groupId>io.opentracing.contrib</groupId>
<artifactId>opentracing-jdbc</artifactId>
<version>0.2.7-SNAPSHOT</version
</dependency>
Sorry, please ignore that. Once you release v0.2.7, I'll update this in SpecialAgent.
@mouseDH 0.2.7 version is released, please try
@malafeev @safris Thks for reply. I will try it!
@mouseDH can be this issue closed now?
please reopen if issue still exists
yeah, this issue can be closed! thks
When i integrated alibaba's druid and java-jdbc, somtimes there is an error was thrown,sometimes is ok. the error message is the follow content:
java.lang.IllegalArgumentException: object is not an instance of declaring class at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211] at io.opentracing.contrib.jdbc.DynamicProxy$1.invoke(DynamicProxy.java:68) ~[opentracing-jdbc-0.2.7-SNAPSHOT.jar:na] at com.sun.proxy.$Proxy39.isReadOnly(Unknown Source) ~[na:na] at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:137) ~[druid-1.1.18.jar:1.1.18] at com.alibaba.druid.pool.DruidConnectionHolder.<init>(DruidConnectionHolder.java:77) ~[druid-1.1.18.jar:1.1.18] at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:933) ~[druid-1.1.18.jar:1.1.18] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1897) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1839) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1767) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:277) ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1255) ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1175) ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:595) ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:376) ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1404) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:847) ~[spring-beans-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.12.RELEASE.jar:5.1.12.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) ~[spring-boot-2.1.11.RELEASE.jar:2.1.11.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) ~[spring-boot-2.1.11.RELEASE.jar:2.1.11.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-2.1.11.RELEASE.jar:2.1.11.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.1.11.RELEASE.jar:2.1.11.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) ~[spring-boot-2.1.11.RELEASE.jar:2.1.11.RELEASE] at com.example.druidopentracejdbc.DruidOpentracejdbcApplication.main(DruidOpentracejdbcApplication.java:19) ~[classes/:na]
my pom.xml: `My application.properties:
spring.datasource.druid.url=jdbc:tracing:mysql://***?useUnicode=true&characterEncoding=utf8&useSSL=true spring.datasource.druid.username=*** spring.datasource.druid.password=*** spring.datasource.druid.driver-class-name=io.opentracing.contrib.jdbc.TracingDriver spring.datasource.druid.initial-size=10 spring.datasource.druid.max-active=50 spring.datasource.druid.min-idle=5 spring.datasource.druid.max-wait=1800000 spring.datasource.druid.pool-prepared-statements=false spring.datasource.druid.max-pool-prepared-statement-per-connection-size=-1 spring.datasource.druid.validation-query=select 1 spring.datasource.druid.validation-query-timeout=60 spring.datasource.druid.test-while-idle=true spring.datasource.druid.time-between-eviction-runs-millis=180000
My Test Code: `package com.example.druidopentracejdbc;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import javax.sql.DataSource; import java.io.Serializable; import java.sql.Connection;
@SpringBootApplication public class DruidOpentracejdbcApplication implements CommandLineRunner {
}' It's happen at: Simetimes the method declareinglcass is com.mysql.jdbc.MySQLConnection, and it's will cause the errors above.