debug运行程序时出现如下错误,求解?
1、输入命令
student add 1001 张三 一班
2、产生如下错误
java.lang.IllegalAccessException: class sms.runtime.CommandRunner (in module sms.runtime) cannot access class sms.service.impl.StudentServiceImpl (in module sms.service) because module sms.service does not export sms.service.impl to module sms.runtime
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:360)
at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:589)
at java.base/java.lang.reflect.Method.invoke(Method.java:556)
at sms.runtime/sms.runtime.CommandRunner.run(CommandRunner.java:40)
at sms.runtime/sms.runtime.Main.main(Main.java:18)
3、service模块声明文件如下
module sms.service { requires sms.model; requires sms.persistence; uses sms.persistence.PersistenceService; provides sms.service.StudentService with sms.service.impl.StudentServiceImpl; exports sms.service; }