Exception in thread "restartedMain" java.lang.IllegalAccessException: Class org.springframework.boot.devtools.restart.RestartLauncher can not access a member of class gym.Registry2Application with modifiers "public static"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296)
at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288)
at java.lang.reflect.Method.invoke(Method.java:491)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Process finished with exit code 0
查看自己的启动类是否加了 public , 我是无public,所以报错

本文详细解析了在使用SpringBoot开发工具时遇到的RestartLauncher无法访问Registry2Application成员的异常问题。通过检查启动类的访问修饰符,发现缺少public关键字是导致错误的根本原因。
1万+

被折叠的 条评论
为什么被折叠?



