spring异常

1.The type org.springframework.core.NestedRuntimeException cannot be resolved. It is indirectly referenced from required .class files

spring的core包异常,在页面上也没有明确的错误地址,此种情况原因为mvn库的springframework使用springboot构造工程导入过依赖jar包,和普通的jar包依赖不一样导致报错。方法就是删除mvn库中的springboot的依赖jar包,重新update 工程(mvn package -U)。

※注意springBoot不能和springmvc的一般配置建立的工程共用一个mvn库。 

2.严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener

ContextLoaderListener 没有找到异常

ContextLoaderListener类 实现ServletContextListener接口,在启动Web容器时,自动装配ApplicationContext.xml的配置信息。默认配置信息在

WEB-INF/ApplicationContext.xml中。当然也可以自定义位置。

3. cvc-complex-type.2.4.a:Invalid content was found starting with element 'bean'

 是因为conponent-scan 不能放在bean中。

 4. spring启动缺少slf4j

可参考以下的log配置。

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.7.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.6</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
      <scope>test</scope>
    </dependency>   
原文地址:https://www.cnblogs.com/DennyZhao/p/7871634.html