一、该问题的重现步骤是什么?
1. 需求是当前登录人只能选择同机构或者下级机构的人或者机构
2.尝试如下配置
3.这里看出应该是规则值不对,跟到这里断点不出具体问题
二、你期待的结果是什么?实际看到的又是什么?
是否现有权限支持粒度能支持到上述需求
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
4.2
参考开发文档5.4.2.1的写法也是这样的错误
### Error querying database. Cause: org.springframework.cglib.core.ReflectUtils$2: No compatible defineClass mechanism detected: JVM should be started with --add-opens=java.base/java.lang=ALL-UNNAMED for ClassLoader.defineClass to be accessible. On the module path, you may not be able to define this CGLIB-generated class at all.
### Cause: org.springframework.cglib.core.ReflectUtils$2: No compatible defineClass mechanism detected: JVM should be started with --add-opens=java.base/java.lang=ALL-UNNAMED for ClassLoader.defineClass to be accessible. On the module path, you may not be able to define this CGLIB-generated class at all.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.5.16.jar:3.5.16]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:156) ~[mybatis-3.5.16.jar:3.5.16]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147) ~[mybatis-3.5.16.jar:3.5.16]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:142) ~[mybatis-3.5.16.jar:3.5.16]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:333) ~[mybatis-spring-3.0.4.jar:3.0.4]
... 117 common frames omitted
Caused by: org.springframework.cglib.core.ReflectUtils$2: No compatible defineClass mechanism detected: JVM should be started with --add-opens=java.base/java.lang=ALL-UNNAMED for ClassLoader.defineClass to be accessible. On the module path, you may not be able to define this CGLIB-generated class at all.
at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:547) ~[spring-core-6.1.14.jar:6.1.14]
at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:371) ~[spring-core-6.1.14.jar:6.1.14]
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.lambda$new$1(AbstractClassGenerator.java:107) ~[spring-core-6.1.14.jar:6.1.14]
at org.springframework.cglib.core.internal.LoadingCache.lambda$createEntry$1(LoadingCache.java:52) ~[spring-core-6.1.14.jar:6.1.14]
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:na]
at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:57) ~[spring-core-6.1.14.jar:6.1.14]
at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) ~[spring-core-6.1.14.jar:6.1.14]
at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:130) ~[spring-core-6.1.14.jar:6.1.14]
at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:317) ~[spring-core-6.1.14.jar:6.1.14]
at org.springblade.core.tool.beans.BladeBeanMap$BladeGenerator.create(BladeBeanMap.java:106) ~[blade-core-tool-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springblade.core.tool.beans.BladeBeanMap.create(BladeBeanMap.java:26) ~[blade-core-tool-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springblade.core.tool.utils.BeanUtil.toMap(BeanUtil.java:377) ~[blade-core-tool-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springblade.core.datascope.handler.BladeDataScopeHandler.sqlCondition(BladeDataScopeHandler.java:77) ~[blade-starter-datascope-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springblade.core.datascope.interceptor.DataScopeInterceptor.intercept(DataScopeInterceptor.java:116) ~[blade-starter-datascope-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springblade.core.mp.plugins.QueryInterceptorExecutor.exec(QueryInterceptorExecutor.java:57) ~[blade-starter-mybatis-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at org.springblade.core.mp.plugins.BladePaginationInterceptor.willDoQuery(BladePaginationInterceptor.java:60) ~[blade-starter-mybatis-4.2.0.RELEASE.jar:4.2.0.RELEASE]
at com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor.intercept(MybatisPlusInterceptor.java:75) ~[mybatis-plus-extension-3.5.8.jar:3.5.8]
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:59) ~[mybatis-3.5.16.jar:3.5.16]
at jdk.proxy2/jdk.proxy2.$Proxy244.query(Unknown Source) ~[na:na]
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:154) ~[mybatis-3.5.16.jar:3.5.16]
... 124 common frames omitted
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @27406a17
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) ~[na:na]
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[na:na]
at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199) ~[na:na]
at java.base/java.lang.reflect.Method.setAccessible(Method.java:193) ~[na:na]
at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:505) ~[spring-core-6.1.14.jar:6.1.14]
... 144 common frames omitted
2024-12-17 08:56:34.483 WARN 12148 --- [sync-scheduler2] RetryableFeignBlockingLoadBalancerClient : Service instance was not resolved, executing the original request
你这个错误是jdk17没有开启模块导致的,具体操作看这里:https://center.javablade.com/blade/BladeX-Doc/src/branch/master/%E7%AC%AC1%E7%AB%A0%20%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B/1.5%20%E5%B7%A5%E7%A8%8B%E8%BF%90%E8%A1%8C/1.5.0%20%E8%BF%90%E8%A1%8C%E5%87%86%E5%A4%87.md
另外自定义sql只能写where条件,不能写left join
扫一扫访问 Blade技术社区 移动端