package springdemo4;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class HelloSpringApp {
public static void main(String[] args) {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
Coach theCoach = context.getBean("myCoach",Coach.class);
System.out.println(theCoach.getDailyFortune());
System.out.println(theCoach.getDailyWorkout());
context.close();
}
}
我运行它,然后它说:
Error occurred during initialization of boot layer java.lang.module.FindException: Unable to derive module descriptor for C:\Users\ngoch\eclipse-workspace\springdemo4\libs\spring-context-indexer-5.1.9.RELEASE-sources.jar Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.springframework.context.index.processor.CandidateComponentsIndexer not in module
请帮忙
最佳答案
我在 Eclipse IDE 上遇到了同样的问题。我错误地在Modulepath下添加了spring jar文件。它应该在 Classpath 下(Properties > Java Build Path > Classpath > addJARs)。
关于Java Spring 错误 : It is not working even i đid exactly everything the teacher said,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57734071/