what is the possible reason causing the Spring boot error

Viewed 118

I am very new to the Spring framework and was creating a simple application while debugging it I get the following run time error:

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

My beans.xml goes like this which resides at location: /Sspring/src/beans.xml:

    <?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>

My provider class goes like this:

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");
        
    }
    

}

My main function goes like this:

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");
    }

}

please help out, what could be possible going wrong? Thanks for any contribution in advance.

1 Answers

Full class name in beans.xml is incorrect. Try this one:

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