gpt4 book ai didi

Java Spring 错误 : It is not working even i đid exactly everything the teacher said

转载 作者:行者123 更新时间:2023-12-03 15:11:53 27 4
gpt4 key购买 nike

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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com