Spring Configuration loading JDBC problem when consolidating multiple MAVEN projects

Source: Internet
Author: User

Description of the problem:

Both projects use JDBC to access the MySQL database, each running OK, but merged into a MAVEN project, found that the previous project access to the database exception, seemingly can't get their own DAO.

Workaround:

Found in the XML configuration of the two projects, there is a common bean, the bean ID is sqlmapclient, because spring is all the configuration files loaded together, so the later sqlmapclient, replaced the previous

Sqlmapclient, and because the two projects access to the MySQL library and table are different, resulting in the previous project JDBC access to MySQL library, so error. The solution is simple, change the two bean ID of the same name to be different, such as one is Sqlmapclient, the other is called SqlMapClient2

Spring Configuration loading JDBC problem when consolidating multiple MAVEN projects

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.