biz工程里想打开sql语句不带问号的功能,遇到问题:Factory method 'sqlLogInterceptor' threw exception;

Blade 未结 2 1462
菲哥
菲哥 2021-02-08 21:19

一、该问题的重现步骤是什么?

  1. 首先,我所有工程都升级到2.7.2了,然后在biz的application-dev.yml中配置如图:

    bladex-01.png

2. 按照楼主的提示,我把blade-Tool都更新了,本地也做了mvn clean install,所有blade的主要服务都把镜像重新推了后,重新构建了。

3. 我只要把红框部分的配置写上,无论sql-log的开关是否打开,它就会报错。这个和pom是否有关系呢?另外我使用这个功能,是否还有什么别的配置的细节没有注意到?


二、你期待的结果是什么?实际看到的又是什么?

我希望能开启sql语句打印不带?的功能。


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

bladex商业版 cloud的版本v2.7.2 biz


四、请提供详细的错误堆栈信息,这很重要。


2021-02-08 21:09:44.897  INFO 25639 --- [           main] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.

2021-02-08 21:09:45.158  INFO 25639 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'

2021-02-08 21:09:45.630  INFO 25639 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService 'taskScheduler'

2021-02-08 21:09:46.169  INFO 25639 --- [           main] o.s.c.b.config.BladeRetryConfiguration   : configServerRetryInterceptor: Changing backOffOptions to initial: 1000, multiplier: 1.2, maxInterval: 5000

2021-02-08 21:09:46.360  INFO 25639 --- [           main] o.s.core.log.logger.BladeLogger          : blade-kxk-wx-mini-api: BladeLogger init success!

2021-02-08 21:09:46.575  WARN 25639 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlLogInterceptor' defined in class path resource [org/springblade/core/mp/config/MybatisPlusConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springblade.core.mp.plugins.SqlLogInterceptor]: Factory method 'sqlLogInterceptor' threw exception; nested exception is java.lang.UnsupportedOperationException

2021-02-08 21:09:46.579  INFO 25639 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Shutting down ExecutorService 'taskScheduler'

2021-02-08 21:09:46.580  INFO 25639 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'

2021-02-08 21:09:52.647  INFO 25639 --- [           main] c.b.d.d.DynamicRoutingDataSource         : dynamic-datasource start closing ....

2021-02-08 21:09:52.655  INFO 25639 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-2} closing ...

2021-02-08 21:09:52.656  INFO 25639 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-2} closed

2021-02-08 21:09:52.656  INFO 25639 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closing ...

2021-02-08 21:09:52.657  INFO 25639 --- [           main] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} closed

2021-02-08 21:09:52.657  INFO 25639 --- [           main] c.b.d.d.DynamicRoutingDataSource         : dynamic-datasource all closed success,bye

2021-02-08 21:09:52.680  INFO 25639 --- [           main] ConditionEvaluationReportLoggingListener : 


Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2021-02-08 21:09:52.695 ERROR 25639 --- [           main] o.s.boot.SpringApplication               : Application run failed


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlLogInterceptor' defined in class path resource [org/springblade/core/mp/config/MybatisPlusConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springblade.core.mp.plugins.SqlLogInterceptor]: Factory method 'sqlLogInterceptor' threw exception; nested exception is java.lang.UnsupportedOperationException

at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657)

at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:637)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897)

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)

at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)

at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:50)

at com.chaorengo.wxmini.KxkWxMiniApplication.main(KxkWxMiniApplication.java:34)

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springblade.core.mp.plugins.SqlLogInterceptor]: Factory method 'sqlLogInterceptor' threw exception; nested exception is java.lang.UnsupportedOperationException

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)

at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:652)

... 19 common frames omitted

Caused by: java.lang.UnsupportedOperationException: null

at java.util.AbstractList.add(AbstractList.java:148)

at java.util.AbstractList.add(AbstractList.java:108)

at java.util.AbstractCollection.addAll(AbstractCollection.java:344)

at org.springblade.core.mp.plugins.SqlLogInterceptor.(SqlLogInterceptor.java:50)

at org.springblade.core.mp.config.MybatisPlusConfiguration.sqlLogInterceptor(MybatisPlusConfiguration.java:121)

at org.springblade.core.mp.config.MybatisPlusConfiguration$$EnhancerBySpringCGLIB$$59d153ba.CGLIB$sqlLogInterceptor$4()

at org.springblade.core.mp.config.MybatisPlusConfiguration$$EnhancerBySpringCGLIB$$59d153ba$$FastClassBySpringCGLIB$$afbc0fbb.invoke()

at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)

at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)

at org.springblade.core.mp.config.MybatisPlusConfiguration$$EnhancerBySpringCGLIB$$59d153ba.sqlLogInterceptor()

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)

... 20 common frames omitted


五、若有更多详细信息,请在下面提供。

2条回答
提交回复