You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.RuntimeException: XXXService_GetNameParameter: frozen class (cannot edit)
at javassist.ClassPool.checkNotFrozen(ClassPool.java:617) ~[javassist-3.21.0-GA.jar:?]
at javassist.ClassPool.makeClass(ClassPool.java:859) ~[javassist-3.21.0-GA.jar:?]
at javassist.ClassPool.makeClass(ClassPool.java:836) ~[javassist-3.21.0-GA.jar:?]
at com.alibaba.dubbo.validation.support.jvalidation.JValidator.getMethodParameterBean(JValidator.java:166)
问题描述
使用Spring Boot构建web app,Controller中通过dubbo消费端远程调用服务端,使用注解进行参数校验,如getName(@NotNull String id)。
在调用过程中始终报错:
java.lang.RuntimeException: XXXService_GetNameParameter: frozen class (cannot edit)
at javassist.ClassPool.checkNotFrozen(ClassPool.java:617) ~[javassist-3.21.0-GA.jar:?]
at javassist.ClassPool.makeClass(ClassPool.java:859) ~[javassist-3.21.0-GA.jar:?]
at javassist.ClassPool.makeClass(ClassPool.java:836) ~[javassist-3.21.0-GA.jar:?]
at com.alibaba.dubbo.validation.support.jvalidation.JValidator.getMethodParameterBean(JValidator.java:166)
问题分析
parameterClass = (Class<?>) Class.forName(parameterClassName, true, clazz.getClassLoader());
这里应该能够找到parameterClass,而不是再次抛出ClassNotFoundException。
parameterClass = ctClass.toClass(clazz.getClassLoader(), null);
传入接口的classLoader,保证其一致性。The text was updated successfully, but these errors were encountered: