zoukankan      html  css  js  c++  java
  • 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");
            
        }
    
    }

    ---哦了

         

      

  • 相关阅读:
    计算机网络概述
    虚拟机网卡配置
    元类
    反射和内置方法
    面向对象的三大特性
    MYSQL中EXISTS的用法
    Guava中的常见集合操作用法
    集合操作交并补的三种Java实现
    P9 get和resize操作(Java 13)
    P8 Java 13中 HashMap的 put方法
  • 原文地址:https://www.cnblogs.com/zhangyu0217----/p/7550874.html
Copyright © 2011-2022 走看看