From 562acd989b4390094795eaa77dbdbff9c831a08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B4=AA=E5=85=89?= Date: Thu, 13 Apr 2023 14:50:30 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=80=9A=E8=BF=87=E7=B1=BB?= =?UTF-8?q?=E5=85=A8=E8=B7=AF=E5=BE=84=E4=BB=8EApplicationContext=E8=AF=BB?= =?UTF-8?q?=E5=8F=96bean=E6=97=B6=EF=BC=8C=E6=8A=A5=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E5=AE=B9=E5=99=A8=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E7=B1=BB=E5=85=A8=E8=B7=AF=E5=BE=84=E4=BB=8E?= =?UTF-8?q?ApplicationContext=E8=AF=BB=E5=8F=96bean=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=8A=A5=E6=97=A0=E6=B3=95=E8=AF=BB=E5=8F=96=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=EF=BC=9B=20=E6=89=80=E4=BB=A5=E5=B0=86SpringContextUtil.getApp?= =?UTF-8?q?licationContext().getBean(handlerClass);=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E4=B8=BA=E9=80=9A=E8=BF=87ClassL?= =?UTF-8?q?oader=E8=BF=9B=E8=A1=8C=E8=8E=B7=E5=8F=96=E3=80=82=20=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E4=BF=A1=E6=81=AF=E5=A6=82=E4=B8=8B=EF=BC=9A=202023-0?= =?UTF-8?q?4-13=2018:47:42.866=20ERROR=208728=20---=20[nio-8411-exec-1]=20?= =?UTF-8?q?c.s.dmp.handler.GlobalExceptionHandler=20=20=20:=20=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E6=93=8D=E4=BD=9C=E5=BC=82=E5=B8=B8=EF=BC=9A?= =?UTF-8?q?nested=20exception=20is=20org.apache.ibatis.exceptions.Persiste?= =?UTF-8?q?nceException:=20###=20Error=20querying=20database.=20=20Cause:?= =?UTF-8?q?=20org.springframework.beans.factory.NoSuchBeanDefinitionExcept?= =?UTF-8?q?ion:=20No=20qualifying=20bean=20of=20type=20'com.scdsp.dmp.hand?= =?UTF-8?q?ler.DeleteFlagDynamicConditionHandler'=20available=20###=20Caus?= =?UTF-8?q?e:=20org.springframework.beans.factory.NoSuchBeanDefinitionExce?= =?UTF-8?q?ption:=20No=20qualifying=20bean=20of=20type=20'com.scdsp.dmp.ha?= =?UTF-8?q?ndler.DeleteFlagDynamicConditionHandler'=20available=20org.myba?= =?UTF-8?q?tis.spring.MyBatisSystemException:=20nested=20exception=20is=20?= =?UTF-8?q?org.apache.ibatis.exceptions.PersistenceException:=20###=20Erro?= =?UTF-8?q?r=20querying=20database.=20=20Cause:=20org.springframework.bean?= =?UTF-8?q?s.factory.NoSuchBeanDefinitionException:=20No=20qualifying=20be?= =?UTF-8?q?an=20of=20type=20'com.scdsp.dmp.handler.DeleteFlagDynamicCondit?= =?UTF-8?q?ionHandler'=20available=20###=20Cause:=20org.springframework.be?= =?UTF-8?q?ans.factory.NoSuchBeanDefinitionException:=20No=20qualifying=20?= =?UTF-8?q?bean=20of=20type=20'com.scdsp.dmp.handler.DeleteFlagDynamicCond?= =?UTF-8?q?itionHandler'=20available=20=09at=20org.mybatis.spring.MyBatisE?= =?UTF-8?q?xceptionTranslator.translateExceptionIfPossible(MyBatisExceptio?= =?UTF-8?q?nTranslator.java:96)=20=09at=20org.mybatis.spring.SqlSessionTem?= =?UTF-8?q?plate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:441)?= =?UTF-8?q?=20=09at=20jdk.proxy2/jdk.proxy2.$Proxy99.selectList(Unknown=20?= =?UTF-8?q?Source)=20=09at=20org.mybatis.spring.SqlSessionTemplate.selectL?= =?UTF-8?q?ist(SqlSessionTemplate.java:224)=20=09at=20com.baomidou.mybatis?= =?UTF-8?q?plus.core.override.MybatisMapperMethod.executeForMany(MybatisMa?= =?UTF-8?q?pperMethod.java:166)=20=09at=20com.baomidou.mybatisplus.core.ov?= =?UTF-8?q?erride.MybatisMapperMethod.execute(MybatisMapperMethod.java:77)?= =?UTF-8?q?=20=09at=20com.baomidou.mybatisplus.core.override.MybatisMapper?= =?UTF-8?q?Proxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148)=20?= =?UTF-8?q?=09at=20com.baomidou.mybatisplus.core.override.MybatisMapperPro?= =?UTF-8?q?xy.invoke(MybatisMapperProxy.java:89)=20=09at=20jdk.proxy3/jdk.?= =?UTF-8?q?proxy3.$Proxy138.selectList(Unknown=20Source)=20=09at=20java.ba?= =?UTF-8?q?se/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native?= =?UTF-8?q?=20Method)=20=09at=20java.base/jdk.internal.reflect.NativeMetho?= =?UTF-8?q?dAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)=20=09at?= =?UTF-8?q?=20java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.?= =?UTF-8?q?invoke(DelegatingMethodAccessorImpl.java:43)=20=09at=20java.bas?= =?UTF-8?q?e/java.lang.reflect.Method.invoke(Method.java:568)=20=09at=20or?= =?UTF-8?q?g.springframework.aop.support.AopUtils.invokeJoinpointUsingRefl?= =?UTF-8?q?ection(AopUtils.java:344)=20=09at=20org.springframework.aop.fra?= =?UTF-8?q?mework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMet?= =?UTF-8?q?hodInvocation.java:198)=20=09at=20org.springframework.aop.frame?= =?UTF-8?q?work.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocat?= =?UTF-8?q?ion.java:163)=20=09at=20com.baomidou.dynamic.datasource.aop.Dyn?= =?UTF-8?q?amicDataSourceAnnotationInterceptor.invoke(DynamicDataSourceAnn?= =?UTF-8?q?otationInterceptor.java:50)=20=09at=20org.springframework.aop.f?= =?UTF-8?q?ramework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInv?= =?UTF-8?q?ocation.java:186)=20=09at=20org.springframework.aop.framework.J?= =?UTF-8?q?dkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)=20=09at?= =?UTF-8?q?=20jdk.proxy3/jdk.proxy3.$Proxy139.selectList(Unknown=20Source)?= =?UTF-8?q?=20=09at=20com.baomidou.mybatisplus.extension.conditions.query.?= =?UTF-8?q?ChainQuery.lambda$list$1d3f6527$1(ChainQuery.java:39)=20=09at?= =?UTF-8?q?=20com.baomidou.mybatisplus.extension.conditions.ChainWrapper.e?= =?UTF-8?q?xecute(ChainWrapper.java:63)=20=09at=20com.baomidou.mybatisplus?= =?UTF-8?q?.extension.conditions.query.ChainQuery.list(ChainQuery.java:39)?= =?UTF-8?q?=20=09at=20com.scdsp.dmp.service.AuthUserService.findMenuTree(A?= =?UTF-8?q?uthUserService.java:75)=20=09at=20com.scdsp.dmp.service.AuthUse?= =?UTF-8?q?rService$$FastClassBySpringCGLIB$$9e145c38.invoke()?= =?UTF-8?q?=20=09at=20org.springframework.cglib.proxy.MethodProxy.invoke(M?= =?UTF-8?q?ethodProxy.java:218)=20=09at=20org.springframework.aop.framewor?= =?UTF-8?q?k.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopP?= =?UTF-8?q?roxy.java:783)=20=09at=20org.springframework.aop.framework.Refl?= =?UTF-8?q?ectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:?= =?UTF-8?q?163)=20=09at=20org.springframework.aop.framework.CglibAopProxy$?= =?UTF-8?q?CglibMethodInvocation.proceed(CglibAopProxy.java:753)=20=09at?= =?UTF-8?q?=20org.springframework.transaction.interceptor.TransactionInter?= =?UTF-8?q?ceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)?= =?UTF-8?q?=20=09at=20org.springframework.transaction.interceptor.Transact?= =?UTF-8?q?ionAspectSupport.invokeWithinTransaction(TransactionAspectSuppo?= =?UTF-8?q?rt.java:388)=20=09at=20org.springframework.transaction.intercep?= =?UTF-8?q?tor.TransactionInterceptor.invoke(TransactionInterceptor.java:1?= =?UTF-8?q?19)=20=09at=20org.springframework.aop.framework.ReflectiveMetho?= =?UTF-8?q?dInvocation.proceed(ReflectiveMethodInvocation.java:186)=20=09a?= =?UTF-8?q?t=20org.springframework.aop.framework.CglibAopProxy$CglibMethod?= =?UTF-8?q?Invocation.proceed(CglibAopProxy.java:753)=20=09at=20org.spring?= =?UTF-8?q?framework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor?= =?UTF-8?q?.intercept(CglibAopProxy.java:698)=20=09at=20com.scdsp.dmp.serv?= =?UTF-8?q?ice.AuthUserService$$EnhancerBySpringCGLIB$$5775a46.findMenuTre?= =?UTF-8?q?e()=20=09at=20com.scdsp.dmp.controller.AuthUserContr?= =?UTF-8?q?oller.findMenuTree(AuthUserController.java:51)=20=09at=20java.b?= =?UTF-8?q?ase/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Nativ?= =?UTF-8?q?e=20Method)=20=09at=20java.base/jdk.internal.reflect.NativeMeth?= =?UTF-8?q?odAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)=20=09at?= =?UTF-8?q?=20java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.?= =?UTF-8?q?invoke(DelegatingMethodAccessorImpl.java:43)=20=09at=20java.bas?= =?UTF-8?q?e/java.lang.reflect.Method.invoke(Method.java:568)=20=09at=20or?= =?UTF-8?q?g.springframework.web.method.support.InvocableHandlerMethod.doI?= =?UTF-8?q?nvoke(InvocableHandlerMethod.java:205)=20=09at=20org.springfram?= =?UTF-8?q?ework.web.method.support.InvocableHandlerMethod.invokeForReques?= =?UTF-8?q?t(InvocableHandlerMethod.java:150)=20=09at=20org.springframewor?= =?UTF-8?q?k.web.servlet.mvc.method.annotation.ServletInvocableHandlerMeth?= =?UTF-8?q?od.invokeAndHandle(ServletInvocableHandlerMethod.java:117)=20?= =?UTF-8?q?=09at=20org.springframework.web.servlet.mvc.method.annotation.R?= =?UTF-8?q?equestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingH?= =?UTF-8?q?andlerAdapter.java:895)=20=09at=20org.springframework.web.servl?= =?UTF-8?q?et.mvc.method.annotation.RequestMappingHandlerAdapter.handleInt?= =?UTF-8?q?ernal(RequestMappingHandlerAdapter.java:808)=20=09at=20org.spri?= =?UTF-8?q?ngframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter?= =?UTF-8?q?.handle(AbstractHandlerMethodAdapter.java:87)=20=09at=20org.spr?= =?UTF-8?q?ingframework.web.servlet.DispatcherServlet.doDispatch(Dispatche?= =?UTF-8?q?rServlet.java:1067)=20=09at=20org.springframework.web.servlet.D?= =?UTF-8?q?ispatcherServlet.doService(DispatcherServlet.java:963)=20=09at?= =?UTF-8?q?=20org.springframework.web.servlet.FrameworkServlet.processRequ?= =?UTF-8?q?est(FrameworkServlet.java:1006)=20=09at=20org.springframework.w?= =?UTF-8?q?eb.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)=20?= =?UTF-8?q?=09at=20javax.servlet.http.HttpServlet.service(HttpServlet.java?= =?UTF-8?q?:655)=20=09at=20org.springframework.web.servlet.FrameworkServle?= =?UTF-8?q?t.service(FrameworkServlet.java:883)=20=09at=20javax.servlet.ht?= =?UTF-8?q?tp.HttpServlet.service(HttpServlet.java:764)=20=09at=20org.apac?= =?UTF-8?q?he.catalina.core.ApplicationFilterChain.internalDoFilter(Applic?= =?UTF-8?q?ationFilterChain.java:227)=20=09at=20org.apache.catalina.core.A?= =?UTF-8?q?pplicationFilterChain.doFilter(ApplicationFilterChain.java:162)?= =?UTF-8?q?=20=09at=20org.apache.tomcat.websocket.server.WsFilter.doFilter?= =?UTF-8?q?(WsFilter.java:53)=20=09at=20org.apache.catalina.core.Applicati?= =?UTF-8?q?onFilterChain.internalDoFilter(ApplicationFilterChain.java:189)?= =?UTF-8?q?=20=09at=20org.apache.catalina.core.ApplicationFilterChain.doFi?= =?UTF-8?q?lter(ApplicationFilterChain.java:162)=20=09at=20org.springframe?= =?UTF-8?q?work.web.filter.RequestContextFilter.doFilterInternal(RequestCo?= =?UTF-8?q?ntextFilter.java:100)=20=09at=20org.springframework.web.filter.?= =?UTF-8?q?OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)=20?= =?UTF-8?q?=09at=20org.apache.catalina.core.ApplicationFilterChain.interna?= =?UTF-8?q?lDoFilter(ApplicationFilterChain.java:189)=20=09at=20org.apache?= =?UTF-8?q?.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilte?= =?UTF-8?q?rChain.java:162)=20=09at=20org.springframework.web.filter.FormC?= =?UTF-8?q?ontentFilter.doFilterInternal(FormContentFilter.java:93)=20=09a?= =?UTF-8?q?t=20org.springframework.web.filter.OncePerRequestFilter.doFilte?= =?UTF-8?q?r(OncePerRequestFilter.java:117)=20=09at=20org.apache.catalina.?= =?UTF-8?q?core.ApplicationFilterChain.internalDoFilter(ApplicationFilterC?= =?UTF-8?q?hain.java:189)=20=09at=20org.apache.catalina.core.ApplicationFi?= =?UTF-8?q?lterChain.doFilter(ApplicationFilterChain.java:162)=20=09at=20o?= =?UTF-8?q?rg.springframework.boot.actuate.metrics.web.servlet.WebMvcMetri?= =?UTF-8?q?csFilter.doFilterInternal(WebMvcMetricsFilter.java:96)=20=09at?= =?UTF-8?q?=20org.springframework.web.filter.OncePerRequestFilter.doFilter?= =?UTF-8?q?(OncePerRequestFilter.java:117)=20=09at=20org.apache.catalina.c?= =?UTF-8?q?ore.ApplicationFilterChain.internalDoFilter(ApplicationFilterCh?= =?UTF-8?q?ain.java:189)=20=09at=20org.apache.catalina.core.ApplicationFil?= =?UTF-8?q?terChain.doFilter(ApplicationFilterChain.java:162)=20=09at=20or?= =?UTF-8?q?g.springframework.web.filter.CharacterEncodingFilter.doFilterIn?= =?UTF-8?q?ternal(CharacterEncodingFilter.java:201)=20=09at=20org.springfr?= =?UTF-8?q?amework.web.filter.OncePerRequestFilter.doFilter(OncePerRequest?= =?UTF-8?q?Filter.java:117)=20=09at=20org.apache.catalina.core.Application?= =?UTF-8?q?FilterChain.internalDoFilter(ApplicationFilterChain.java:189)?= =?UTF-8?q?=20=09at=20org.apache.catalina.core.ApplicationFilterChain.doFi?= =?UTF-8?q?lter(ApplicationFilterChain.java:162)=20=09at=20org.apache.cata?= =?UTF-8?q?lina.core.StandardWrapperValve.invoke(StandardWrapperValve.java?= =?UTF-8?q?:197)=20=09at=20org.apache.catalina.core.StandardContextValve.i?= =?UTF-8?q?nvoke(StandardContextValve.java:97)=20=09at=20org.apache.catali?= =?UTF-8?q?na.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.jav?= =?UTF-8?q?a:540)=20=09at=20org.apache.catalina.core.StandardHostValve.inv?= =?UTF-8?q?oke(StandardHostValve.java:135)=20=09at=20org.apache.catalina.v?= =?UTF-8?q?alves.ErrorReportValve.invoke(ErrorReportValve.java:92)=20=09at?= =?UTF-8?q?=20org.apache.catalina.core.StandardEngineValve.invoke(Standard?= =?UTF-8?q?EngineValve.java:78)=20=09at=20org.apache.catalina.connector.Co?= =?UTF-8?q?yoteAdapter.service(CoyoteAdapter.java:357)=20=09at=20org.apach?= =?UTF-8?q?e.coyote.http11.Http11Processor.service(Http11Processor.java:38?= =?UTF-8?q?2)=20=09at=20org.apache.coyote.AbstractProcessorLight.process(A?= =?UTF-8?q?bstractProcessorLight.java:65)=20=09at=20org.apache.coyote.Abst?= =?UTF-8?q?ractProtocol$ConnectionHandler.process(AbstractProtocol.java:89?= =?UTF-8?q?5)=20=09at=20org.apache.tomcat.util.net.NioEndpoint$SocketProce?= =?UTF-8?q?ssor.doRun(NioEndpoint.java:1732)=20=09at=20org.apache.tomcat.u?= =?UTF-8?q?til.net.SocketProcessorBase.run(SocketProcessorBase.java:49)=20?= =?UTF-8?q?=09at=20org.apache.tomcat.util.threads.ThreadPoolExecutor.runWo?= =?UTF-8?q?rker(ThreadPoolExecutor.java:1191)=20=09at=20org.apache.tomcat.?= =?UTF-8?q?util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.j?= =?UTF-8?q?ava:659)=20=09at=20org.apache.tomcat.util.threads.TaskThread$Wr?= =?UTF-8?q?appingRunnable.run(TaskThread.java:61)=20=09at=20java.base/java?= =?UTF-8?q?.lang.Thread.run(Thread.java:833)=20Caused=20by:=20org.apache.i?= =?UTF-8?q?batis.exceptions.PersistenceException:=20###=20Error=20querying?= =?UTF-8?q?=20database.=20=20Cause:=20org.springframework.beans.factory.No?= =?UTF-8?q?SuchBeanDefinitionException:=20No=20qualifying=20bean=20of=20ty?= =?UTF-8?q?pe=20'com.scdsp.dmp.handler.DeleteFlagDynamicConditionHandler'?= =?UTF-8?q?=20available=20###=20Cause:=20org.springframework.beans.factory?= =?UTF-8?q?.NoSuchBeanDefinitionException:=20No=20qualifying=20bean=20of?= =?UTF-8?q?=20type=20'com.scdsp.dmp.handler.DeleteFlagDynamicConditionHand?= =?UTF-8?q?ler'=20available=20=09at=20org.apache.ibatis.exceptions.Excepti?= =?UTF-8?q?onFactory.wrapException(ExceptionFactory.java:30)=20=09at=20org?= =?UTF-8?q?.apache.ibatis.session.defaults.DefaultSqlSession.selectList(De?= =?UTF-8?q?faultSqlSession.java:153)=20=09at=20org.apache.ibatis.session.d?= =?UTF-8?q?efaults.DefaultSqlSession.selectList(DefaultSqlSession.java:145?= =?UTF-8?q?)=20=09at=20org.apache.ibatis.session.defaults.DefaultSqlSessio?= =?UTF-8?q?n.selectList(DefaultSqlSession.java:140)=20=09at=20jdk.internal?= =?UTF-8?q?.reflect.GeneratedMethodAccessor175.invoke(Unknown=20Source)=20?= =?UTF-8?q?=09at=20java.base/jdk.internal.reflect.DelegatingMethodAccessor?= =?UTF-8?q?Impl.invoke(DelegatingMethodAccessorImpl.java:43)=20=09at=20jav?= =?UTF-8?q?a.base/java.lang.reflect.Method.invoke(Method.java:568)=20=09at?= =?UTF-8?q?=20org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.?= =?UTF-8?q?invoke(SqlSessionTemplate.java:427)=20=09...=2089=20more=20Caus?= =?UTF-8?q?ed=20by:=20org.springframework.beans.factory.NoSuchBeanDefiniti?= =?UTF-8?q?onException:=20No=20qualifying=20bean=20of=20type=20'com.scdsp.?= =?UTF-8?q?dmp.handler.DeleteFlagDynamicConditionHandler'=20available=20?= =?UTF-8?q?=09at=20org.springframework.beans.factory.support.DefaultListab?= =?UTF-8?q?leBeanFactory.getBean(DefaultListableBeanFactory.java:351)=20?= =?UTF-8?q?=09at=20org.springframework.beans.factory.support.DefaultListab?= =?UTF-8?q?leBeanFactory.getBean(DefaultListableBeanFactory.java:342)=20?= =?UTF-8?q?=09at=20org.springframework.context.support.AbstractApplication?= =?UTF-8?q?Context.getBean(AbstractApplicationContext.java:1172)=20=09at?= =?UTF-8?q?=20com.tangzc.mpe.condition.DynamicConditionInterceptor.getExpr?= =?UTF-8?q?ession(DynamicConditionInterceptor.java:142)=20=09at=20com.tang?= =?UTF-8?q?zc.mpe.condition.DynamicConditionInterceptor.processPlainSelect?= =?UTF-8?q?(DynamicConditionInterceptor.java:132)=20=09at=20com.tangzc.mpe?= =?UTF-8?q?.condition.DynamicConditionInterceptor.processSelectBody(Dynami?= =?UTF-8?q?cConditionInterceptor.java:109)=20=09at=20com.tangzc.mpe.condit?= =?UTF-8?q?ion.DynamicConditionInterceptor.processSelect(DynamicConditionI?= =?UTF-8?q?nterceptor.java:104)=20=09at=20com.baomidou.mybatisplus.extensi?= =?UTF-8?q?on.parser.JsqlParserSupport.processParser(JsqlParserSupport.jav?= =?UTF-8?q?a:91)=20=09at=20com.tangzc.mpe.condition.DynamicConditionInterc?= =?UTF-8?q?eptor.changeSql(DynamicConditionInterceptor.java:63)=20=09at=20?= =?UTF-8?q?com.tangzc.mpe.condition.DynamicConditionInterceptor.beforeQuer?= =?UTF-8?q?y(DynamicConditionInterceptor.java:45)=20=09at=20com.baomidou.m?= =?UTF-8?q?ybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(M?= =?UTF-8?q?ybatisPlusInterceptor.java:78)=20=09at=20org.apache.ibatis.plug?= =?UTF-8?q?in.Plugin.invoke(Plugin.java:62)=20=09at=20jdk.proxy2/jdk.proxy?= =?UTF-8?q?2.$Proxy159.query(Unknown=20Source)=20=09at=20org.apache.ibatis?= =?UTF-8?q?.session.defaults.DefaultSqlSession.selectList(DefaultSqlSessio?= =?UTF-8?q?n.java:151)=20=09...=2095=20more?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈洪光 --- .../DynamicConditionInterceptor.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/mybatis-plus-ext-core/mybatis-plus-ext-condition/src/main/java/com/tangzc/mpe/condition/DynamicConditionInterceptor.java b/mybatis-plus-ext-core/mybatis-plus-ext-condition/src/main/java/com/tangzc/mpe/condition/DynamicConditionInterceptor.java index 99368cce..8f77c06b 100644 --- a/mybatis-plus-ext-core/mybatis-plus-ext-condition/src/main/java/com/tangzc/mpe/condition/DynamicConditionInterceptor.java +++ b/mybatis-plus-ext-core/mybatis-plus-ext-condition/src/main/java/com/tangzc/mpe/condition/DynamicConditionInterceptor.java @@ -139,8 +139,21 @@ public class DynamicConditionInterceptor extends JsqlParserSupport implements In for (DynamicConditionDescription description : descriptions) { Field entityField = description.getEntityField(); Class handlerClass = description.getDynamicCondition().value(); - IDynamicConditionHandler conditionHandler = SpringContextUtil.getApplicationContext().getBean(handlerClass); - + // IDynamicConditionHandler conditionHandler = SpringContextUtil.getApplicationContext().getBean(handlerClass); + + String className = handlerClass.getName(); + ApplicationContext context = SpringContextUtil.getApplicationContext(); + ClassLoader classLoader = context.getClassLoader(); + if (classLoader != null) { + conditionHandler = (IDynamicConditionHandler)context.getBean(classLoader.loadClass(className)); + }else{ + String[] split = className.split("\\."); + String beanName = split[split.length - 1]; + char[] cs = beanName.toCharArray(); + cs[0] += 32; + beanName = String.valueOf(cs); + conditionHandler = (IDynamicConditionHandler)context.getBean(beanName); + } // 表示该条件跳过,不参与过滤 if (!conditionHandler.enable()) { continue; @@ -168,6 +181,8 @@ public class DynamicConditionInterceptor extends JsqlParserSupport implements In } } catch (JSQLParserException e) { e.printStackTrace(); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); } return where; } -- Gitee