hyz1994121 opened a new issue, #21083:
URL: https://github.com/apache/shardingsphere/issues/21083

   
   
   shardingsphere-jdbc-core-spring-namespace version old 5.1.1 to new 5.2.0
   project start, i got error logs, 
   Failed to instantiate 
[org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource]:
 Constructor threw exception; nested exception is Can't construct a java object 
for tag:yaml.org,2002:com.alibaba.druid.filter.stat.StatFilter; exception=Class 
is not accepted: com.alibaba.druid.filter.stat.StatFilter in 'string', line 76, 
column 5: - !!com.alibaba.druid.filter.stat. ... ^
   
   start project by debug 
   i got the ymal content like this 
   
   dataSource:
     connectionErrorRetryAttempts: 1
     initGlobalVariants: false
     notEmptyWaitNanos: 0
     executeUpdateCount: 0
     mbeanRegistered: false
     failContinuous: false
     initExceptionThrow: true
     dupCloseLogEnable: false
     logAbandoned: false
     password: XXX
     maxIdle: 8
     removeAbandoned: false
     cachedPreparedStatementDeleteCount: 0
     enable: true
     rawDriverMajorVersion: -1
     discardCount: 0
     initVariants: false
     errorCount: 0
     transactionThresholdMillis: 0
     createTimespanMillis: 0
     minIdle: 3
     destroyCount: 0
     asyncCloseConnectionEnable: false
     connectErrorCount: 0
     notFullTimeoutRetryCount: 0
     notEmptyWaitMillis: 0
     breakAfterAcquireFailure: false
     cachedPreparedStatementMissCount: 0
     notEmptySignalCount: 0
     version: 1.2.4
     onFatalErrorMaxActive: 0
     sharePreparedStatements: false
     rawDriverMinorVersion: -1
     driverMajorVersion: -1
     maxEvictableIdleTimeMillis: 25200000
     rawJdbcUrl: JDBC-URL
     phyTimeoutMillis: -1
     killWhenSocketReadTimeout: false
     useGlobalDataSourceStat: false
     onFatalError: false
     checkExecuteTime: false
     waitThreadCount: 0
     startTransactionCount: 0
     poolPreparedStatements: false
     phyMaxUseCount: -1
     maxOpenPreparedStatements: 10
     rollbackCount: 0
     closedPreparedStatementCount: 0
     recycleErrorCount: 0
     removeAbandonedCount: 0
     lastCreateErrorTimeMillis: 0
     preparedStatementCount: 0
     activeCount: 0
     keepAliveBetweenTimeMillis: 120000
     keepAlive: false
     closeCount: 0
     url: JDBC-URL
     transactionQueryTimeout: 0
     testOnBorrow: false
     createCount: 0
     minEvictableIdleTimeMillis: 300000
     timeBetweenEvictionRunsMillis: 10000
     testOnReturn: false
     closed: false
     maxActive: 20
     notEmptyWaitThreadCount: 0
     dupCloseCount: 0
     resetCount: 0
     commitCount: 0
     maxPoolPreparedStatementPerConnectionSize: 10
     testWhileIdle: true
     andResetExecuteCount: 0
     dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
     proxyFilters:
     - !!com.alibaba.druid.filter.stat.StatFilter
       connectionStackTraceEnable: false
       logSlowSql: false
       mergeSql: false
       slowSqlMillis: 3000
     asyncInit: false
     resetStatEnable: true
     notEmptyWaitCount: 0
     cachedPreparedStatementCount: 0
     oracle: false
     maxWait: 60000
     cachedPreparedStatementAccessCount: 0
     executeCount: 0
     failFast: false
     recycleCount: 0
     clearFiltersEnable: true
     name: DataSource-882144085
     executeCount2: 0
     maxCreateTaskCount: 3
     validationQueryTimeout: -1
     full: false
     queryTimeout: 0
     poolingPeak: 0
     validationQuery: SELECT 'x'
     inited: false
     useOracleImplicitCache: true
     lastErrorTimeMillis: 0
     createErrorCount: 0
     maxWaitThreadCount: -1
     connectCount: 0
     notEmptyWaitThreadPeak: 0
     cachedPreparedStatementHitCount: 0
     filterClassNames:
     - com.alibaba.druid.filter.stat.StatFilter
     useUnfairLock: false
     activePeak: 0
     logDifferentThread: true
     removeAbandonedTimeout: 300
     defaultAutoCommit: true
     poolingCount: 0
     createTimespanNano: 0
     timeBetweenConnectErrorMillis: 500
     timeBetweenLogStatsMillis: 0
     initialSize: 6
     removeAbandonedTimeoutMillis: 300000
     executeQueryCount: 0
     lockQueueLength: 0
     executeBatchCount: 0
     numTestsPerEvictionRun: 3
     accessToUnderlyingConnectionAllowed: true
     driverMinorVersion: -1
     iD: 0
     properties: '{}'
     useLocalSessionState: true
     username: username
   
   excption on this
   
org.apache.shardingsphere.infra.util.yaml.constructor.ShardingSphereYamlConstructor#getClassForName
 
           throw new IllegalArgumentException(String.format("Class is not 
accepted: %s", className));
   
   the exception is , rootClass is java.lang.HashMap
   but the className is com.alibaba.druid.filter.stat.StatFilter
   is there some bugs? or i need to update my configs?
   
   <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" 
destroy-method="close">
           <property name="driverClassName" value="${dataSource.driver}"/>
           <property name="url" value="${dataSource.url}"/>
           <property name="username" value="${dataSource.username}"/>
           <property name="password" value="${dataSource.password}"/>
           <property name="filters" value="stat"/>
           <property name="maxActive" value="${dataSource.maxActive}"/>
           <property name="initialSize" value="${dataSource.initialSize}"/>
           <property name="maxWait" value="60000"/>
           <property name="minIdle" value="3"/>
           <property name="timeBetweenEvictionRunsMillis" value="10000"/>
           <property name="minEvictableIdleTimeMillis" value="300000"/>
           <property name="validationQuery" value="SELECT 'x'"/>
           <property name="testWhileIdle" value="true"/>
           <property name="testOnBorrow" value="false"/>
           <property name="testOnReturn" value="false"/>
       </bean>
   
    <shardingsphere:data-source id="druidDataSource" 
data-source-names="dataSource" rule-refs="shardingRule">
           <props>
               <prop key="sql-show">false</prop>
           </props>
       </shardingsphere:data-source>
   
   this is my spring-name-space xml config
   
   
   升级到5.2.0版本以后启动报错,debug后发现解析类出错
   
   
   


-- 
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.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to