首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >导致Spring启动错误的可能原因是什么

导致Spring启动错误的可能原因是什么
EN

Stack Overflow用户
提问于 2021-04-10 16:05:17
回答 1查看 57关注 0票数 2

我对Spring框架非常陌生,在调试它时创建了一个简单的应用程序,我得到了以下运行时错误:

代码语言:javascript
运行
复制
Error occurred during initialization of boot layer
java.lang.module.FindException: Unable to derive module descriptor for C:\Users\Downloads\spring-5.3.5-dist\spring-framework-5.3.5\libs\spring-context-indexer-5.3.5-sources.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: Provider class org.springframework.context.index.processor.CandidateComponentsIndexer not in module

我的beans.xml是这样的,它位于位置:/Sspring/src/beans.xml

代码语言:javascript
运行
复制
    <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        https://www.springframework.org/schema/beans/spring-beans.xsd">

<bean id="provider" class="com.selnium.Provider"></bean>
</beans>

我的provider类是这样的:

代码语言:javascript
运行
复制
package selnium;

public class Provider implements Sim{

    @Override
    public void calling() {
        System.out.println("calling using new provider");
        
    }

    @Override
    public void data() {
        System.out.println("browsing using new provider");
        
    }
    

}

我的main函数是这样的:

代码语言:javascript
运行
复制
package selnium;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mobile {
    
    public static void main(String[] args) {
        
        ApplicationContext context=new ClassPathXmlApplicationContext("beans.xml");
        System.out.println("config loaded");
    }

}

请帮帮忙,怎么会出问题呢?感谢您提前做出的贡献。

EN

回答 1

Stack Overflow用户

发布于 2021-04-10 17:03:31

beans.xml中的完整类名称不正确。试试这个:

代码语言:javascript
运行
复制
<bean id="provider" class="selnium.Provider"></bean>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67032111

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档