Spring Auto Scan does not support jar packages <component-scan>

Source: Internet
Author: User

Problem Description:

Native Windows myeclipse10.7 runs a non-maven Java project, where some classes are injected using SPRING3 annotations, scanned using a configuration file Component-scan, and everything works in the native debug test, But when it hits a jar and puts it on a Linux server, it always says: Org.springframework.beans.factory.NoSuchBeanDefinitionException:No Bean named ' XXXX ' is Defined

Check the note name, configuration file, file encoding, and modify the configuration and so on try to not solve after the online browsing all kinds of data finally solved, here to make notes.

This machine's class file is directly compiled into the class directory for direct drinking, Component-scan can directly scan the class directory, but packaged into a jar Spring3 Component-scan will not be scanned, actually not scanning Instead, there is a DD entity directory (add entity directory) attribute when hitting the jar package, which needs to be checked as

Spring Auto Scan does not support jar packages <component-scan>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.