1.<context:annotation-config/>注册多个处理器

<context:annotation-config/>作用是向 Spring 容器注册

AutowiredAnnotationBeanPostProcessor(@Autowired)、

CommonAnnotationBeanPostProcessor(@Resource 、@PostConstruct、@PreDestroy)、

PersistenceAnnotationBeanPostProcessor (@PersistenceContext)

RequiredAnnotationBeanPostProcessor (@Required)

这 4 个BeanPostProcessor。

2.配置<context:component-scan/>更省事

<context:component-scan base-package=”XX.XX”/> 该配置项其实也包含了自动注入上述processor的功能,因此当使用 <context:component-scan/> 后,就可以将 <context:annotation-config/> 移除了。

"context:annotation-config" and "context:component-scan"的更多相关文章

  1. Mingyang.net:org.springframework.context.annotation.ConflictingBeanDefinitionException

    org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean ...

  2. 【原创】大叔经验分享(16)Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    今天尝试运行一个古老的工程,配置好之后编译通过,结果运行时报错: org.springframework.beans.factory.BeanDefinitionStoreException: Une ...

  3. spring 2.5.6 错误:Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    在运行一个第三方公司交付的项目的时候, 出现: Caused by: java.lang.IllegalStateException: Context namespace element 'annot ...

  4. Caused by: org.springframework.context.annotation.ConflictingBeanDefinitionException

    org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean ...

  5. Context namespace element 'annotation-config' and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser]

    严重: Exception sending context initialized event to listener instance of class org.springframework.we ...

  6. class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    在搭建SSM项目时报了以下的错误: 06-Oct-2019 11:55:52.109 信息 [RMI TCP Connection(5)-127.0.0.1] org.apache.catalina. ...

  7. [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher 问题--MyEclipse设置JDK版本

    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML doc ...

  8. Context namespace element 'component-scan' and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

    异常信息如下: 错误: Unexpected exception parsing XML document from class path resource [spring/applicationCo ...

  9. Context namespace element 'annotation-config' and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on JDK 1.5 and higher

    Context namespace element 'annotation-config' and its parser class [org.springframework.context.anno ...

  10. Spring配置之context:annotation与、component-scan以及annotation-driven

    spring boot帮助我们隐藏了大量的细节,有些配置spring boot都是开启的,因此当我们查看遗留项目使用spring时候遇见问题一定细心排查 <!-- context:annotat ...

随机推荐

  1. 【Java知识点专项练习】之 数据类型两大类

    Java的数据类型分为两大类:基本类型和引用类型: 基本类型只能保存一些常量数据,引用类型除了可以保存数据,还能提供操作这些数据的功能: 为了操作基本类型的数据,java也对它们进行了封装, 得到八个 ...

  2. ASP/SQL 注入天书

    引言 随着 B/S 模式应用开发的发展,使用这种模式编写应用程序的程序员也越来越多.但是由于这个行业的入门门槛不高,程序员的水平及经验也参差不齐,相当大一部分程序员在编写代码的时候,没有对用户输入数据 ...

  3. 【大数据系列】apache hive 官方文档翻译

    GettingStarted 开始 Created by Confluence Administrator, last modified by Lefty Leverenz on Jun 15, 20 ...

  4. linux ntp时间服务器配置

    Network Time Protocol (NTP) 也是RHCE新增的考试要求. 学习的时候也顺便复习了一下如何设置Linux的时间,现在拿出来和大家分享 设置NTP服务器不难但是NTP本身是一个 ...

  5. Sass::SyntaxError related to active_admin/mixins

    in active_admin.css.sass, change: @import "active_admin/mixins"; @import "active_admi ...

  6. VC/MFC程序开启关闭和打开自己或其他软件,更改窗口类

    一. 关闭自身软件 直接在需要关闭的位置输入 HANDLE hself = GetCurrentProcess(); TerminateProcess(hself, 0); 二.关闭其他软件 流程: ...

  7. 关于hp proliant sl210t服务器远程iLO接口的管理配置

    提到hp proliant sl210t服务器,首先得提到HP ProLiant SL2500,HP ProLiant SL2500 可扩展系统提供了 一个非常密集的解决方案,可在标准 2U 机箱最多 ...

  8. IOS控制系统手势返回

    self.navigationController.interactivePopGestureRecognizer.enabled = YES; //手势返回的代理,如果自定义了leftButtonI ...

  9. ThinkCMF----调用指定栏目的文章列表

    做项目的时候,在用ThinkCMF在首页调用指定的栏目文章,但是没有找到好的方法,就自己写了一个. 但是又不想写标签,就在公用方法里面实现了:找到common.php 操作数据库,要用到think的控 ...

  10. table中强制不换行

    总是一些文章说要强制换行,很少提到说如何不换行. 一般都会使用word-break: keep-all;使得强制不换行. HTML <!DOCTYPE html PUBLIC "-// ...