The constructor ClassPathXmlApplicationContext(String) refers to the missing type BeansException


“The constructor ClassPathXmlApplicationContext(String) refers to the missing type BeansException”

“构造函数ClassPathXmlApplicationContext(字符串)是指缺失类型BeansException”

出现错误的原因:jar没有正确引入,即使表面上你能import包。

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

如果你用的eclipes解决 方案:

  进入你的maven仓库,本地的,删除关于spring-core,spring-context,删除了之后,让工具重新下载一下

然后update maven一下  就ok了

 

 

package zy.test;

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

public class TestUser {
    
    @Test
    public void Test(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        
    }

}

---哦了

 

 

     

  

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM